Skip to content

Commit

Permalink
Merge pull request #987 from etcimon/patch-2
Browse files Browse the repository at this point in the history
struct destructors are not being called
  • Loading branch information
s-ludwig committed Feb 23, 2015
2 parents 2b8b187 + 2b8a060 commit bfe0638
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/vibe/utils/memory.d
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ template FreeListObjectAlloc(T, bool USE_GC = true, bool INIT = true)
static if( INIT ){
scope(failure) assert(0, "You shouldn't throw in destructors");
auto objc = obj;
.destroy(objc);//typeid(T).destroy(cast(void*)obj);
static if (is(TR == T*)) .destroy(*objc);//typeid(T).destroy(cast(void*)obj);
else .destroy(objc);
}
static if( hasIndirections!T ) GC.removeRange(cast(void*)obj);
manualAllocator().free((cast(void*)obj)[0 .. ElemSize]);
Expand Down

0 comments on commit bfe0638

Please sign in to comment.