Fix some memory leaks

This commit is contained in:
Wojtek Figat
2021-08-13 13:13:12 +02:00
parent af22c7e96f
commit 7fc144b07b
2 changed files with 29 additions and 3 deletions

View File

@@ -134,9 +134,13 @@ void JobSystemService::Dispose()
for (int32 i = 0; i < ThreadsCount; i++)
{
if (Threads[i] && Threads[i]->IsRunning())
Threads[i]->Kill(true);
Threads[i] = nullptr;
if (Threads[i])
{
if (Threads[i]->IsRunning())
Threads[i]->Kill(true);
Delete(Threads[i]);
Threads[i] = nullptr;
}
}
}