Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1857 from Calrama/fixmemleak
Browse files Browse the repository at this point in the history
Fix leaking main thread held memory
merged-on-behalf-of: Sebastian Wilzbach <[email protected]>
  • Loading branch information
dlang-bot authored Sep 17, 2017
2 parents c39db9d + c4f0d0d commit 95fd6e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/core/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -2087,6 +2087,9 @@ extern (C) void thread_init()
*/
extern (C) void thread_term()
{
destroy(Thread.sm_main);
Thread.sm_main = null;

assert(Thread.sm_tbeg && Thread.sm_tlen == 1);
assert(!Thread.nAboutToStart);
if (Thread.pAboutToStart) // in case realloc(p, 0) doesn't return null
Expand Down
2 changes: 0 additions & 2 deletions src/rt/sections_elf_shared.d
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,6 @@ extern(C) void _d_dso_registry(CompilerDSOData* data)
else
{
// static DSOs are unloaded in reverse order
assert(pdso._tlsSize == _tlsRanges.back.length);
_tlsRanges.popBack();
assert(pdso == _loadedDSOs.back);
_loadedDSOs.popBack();
}
Expand Down

0 comments on commit 95fd6e1

Please sign in to comment.