gc_term() memory leaking.
Neal Alexander
wqeqweuqy at hotmail.com
Sat Jul 7 20:42:23 PDT 2007
Is there any way to force a GC instance in a DLL to free the heap pages
allocated by gc_init? gc_term()is just an alias to fullCollectNoStack().
the following DLL leaks around 1,000-2,000K each time the dll is reloaded.
extern (Windows):
BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved)
{
g_hInst = hInstance;
switch (ulReason){
case DLL_PROCESS_ATTACH:
gc_init();
_minit();
_moduleCtor();
activate();
break;
case DLL_PROCESS_DETACH:
_moduleDtor();
gc_term();
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
return false;
}
return TRUE;
}
More information about the Digitalmars-d-learn
mailing list