Fix an iterator corruption on tls thread autofree.

This commit is contained in:
Unknown W. Brackets committed 2015-02-21 15:50:20 -08:00
1 parent 8d15cb953a
commit 8a0f854dc6
1 file changed
+8
+8
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);
}