Skip to content

Commit

Permalink
[MERGE #3092 @leirocks] fix handle leak for recycler concurrent thread
Browse files Browse the repository at this point in the history
Merge pull request #3092 from leirocks:handleleak
  • Loading branch information
leirocks committed Jun 2, 2017
2 parents 3f50e98 + 0c7fe52 commit cb98dd7
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/Common/Memory/Recycler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4613,7 +4613,11 @@ Recycler::FinalizeConcurrent(bool restoreState)
}

this->threadService = nullptr;
this->concurrentThread = nullptr;
if (concurrentThread != NULL)
{
CloseHandle(concurrentThread);
this->concurrentThread = nullptr;
}
}

bool
Expand Down Expand Up @@ -4745,10 +4749,6 @@ Recycler::ShutdownThread()
Assert(concurrentThread != NULL || threadService->HasCallback());

FinalizeConcurrent(false);
if (concurrentThread)
{
CloseHandle(concurrentThread);
}
}
}

Expand All @@ -4760,10 +4760,6 @@ Recycler::DisableConcurrent()
Assert(concurrentThread != NULL || threadService->HasCallback());

FinalizeConcurrent(true);
if (concurrentThread)
{
CloseHandle(concurrentThread);
}
this->collectionState = CollectionStateNotCollecting;
}
}
Expand Down

0 comments on commit cb98dd7

Please sign in to comment.