Fix an iterator corruption on tls thread autofree.

This commit is contained in:
Unknown W. Brackets 2015-02-16 01:45:02 -08:00
parent 8d15cb953a
commit 8a0f854dc6

View File

@ -2011,7 +2011,15 @@ void __KernelTlsplThreadEnd(SceUID threadID)
TLSPL *tls = kernelObjects.Get<TLSPL>(tlsID, error);
if (tls)
{
__KernelFreeTls(tls, threadID);
// Restart the loop, freeing mutated it.
locked = tlsplThreadEndChecks.equal_range(threadID);
iter = locked.first;
if (locked.first == locked.second)
break;
}
}
tlsplThreadEndChecks.erase(locked.first, locked.second);
}