FileView: Fixed heap corruption.

This commit is contained in:
Brian Ferguson 2013-03-07 22:53:58 -07:00
parent c5df90bbee
commit ddbdc71111

View File

@ -650,21 +650,18 @@ PLUGIN_EXPORT void Finalize(void* data)
ParentMeasure* parent = child->parent;
EnterCriticalSection(&g_CriticalSection);
if (parent->thread)
{
TerminateThread(parent->thread, 0);
parent->thread = nullptr;
}
if (parent && parent->ownerChild == child)
{
CloseHandle(parent->thread);
parent->thread = nullptr;
delete parent;
if (parent->thread)
{
TerminateThread(parent->thread, 0);
parent->thread = nullptr;
}
auto iter = std::find(g_ParentMeasures.begin(), g_ParentMeasures.end(), parent);
g_ParentMeasures.erase(iter);
delete parent;
}
delete child;