Skip to content

Commit

Permalink
destory leaks on set when lifetime ends
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmankoko committed Sep 6, 2024
1 parent be1866b commit 399e900
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/stdcpp/set.d
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ version (CppRuntime_Gcc)

inout(pointer) find(const ref _Key __k) inout;

/*
* clang on linux only emits the base object dtor(D2)
* so we can safely force mangle it to that
* since the complete dtor(D1) calls D2 in its stack frame
*/
pragma(mangle, "_ZNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEED2Ev")
~this();
}
}

0 comments on commit 399e900

Please sign in to comment.