Skip to content

Commit

Permalink
[1.5>1.6] [1.4>1.5] [MERGE #3092 @leirocks] fix handle leak for recyc…
Browse files Browse the repository at this point in the history
…ler concurrent thread

Merge pull request #3092 from leirocks:handleleak
  • Loading branch information
leirocks committed Jun 2, 2017
2 parents 6da1e8c + 07c15e7 commit dd8684f
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 @@ -4858,7 +4858,11 @@ Recycler::FinalizeConcurrent(bool restoreState)
}

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

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

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

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

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

0 comments on commit dd8684f

Please sign in to comment.