fix memory leak in leak detection code :P

This was SVN commit r6257.
This commit is contained in:
janwas 2008-07-19 18:35:33 +00:00
parent 6eb29f76d3
commit e063542a5f

View File

@ -13,6 +13,7 @@
WINIT_REGISTER_EARLY_INIT2(wdbg_heap_Init); // wutil -> wdbg_heap
WINIT_REGISTER_LATE_SHUTDOWN2(wdbg_heap_Shutdown); // last - no leaks are detected after this
void wdbg_heap_Enable(bool enable)
@ -901,6 +902,10 @@ intptr_t wdbg_heap_NumberOfAllocations()
//-----------------------------------------------------------------------------
#ifndef NDEBUG
static AllocationTracker* s_tracker;
#endif
static LibError wdbg_heap_Init()
{
#ifndef NDEBUG
@ -914,7 +919,6 @@ static LibError wdbg_heap_Init()
if(ret == -1)
abort();
static AllocationTracker* s_tracker;
s_tracker = new AllocationTracker;
#endif
@ -922,3 +926,12 @@ static LibError wdbg_heap_Init()
return INFO::OK;
}
static LibError wdbg_heap_Shutdown()
{
#ifndef NDEBUG
SAFE_DELETE(s_tracker);
#endif
return INFO::OK;
}