void tear_down_hook() { gc_unregister_root(gc, (void **)&value); gc_unregister_root(gc, (void **)&key1); gc_unregister_root(gc, &hash); /* Shutdown the GC */ gc_destroy(gc); }
GGPROTO::~GGPROTO() { #ifdef DEBUGMODE debugLogA("~GGPROTO(): destroying protocol interface"); #endif // Destroy modules block_uninit(); img_destroy(); keepalive_destroy(); gc_destroy(); Popup_UnregisterClass(hPopupError); Popup_UnregisterClass(hPopupNotify); if (hMenuRoot) CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)hMenuRoot, 0); // Close handles Netlib_CloseHandle(m_hNetlibUser); // Destroy mutexes DeleteCriticalSection(&sess_mutex); DeleteCriticalSection(&ft_mutex); DeleteCriticalSection(&img_mutex); DeleteCriticalSection(&modemsg_mutex); DeleteCriticalSection(&avatar_mutex); DeleteCriticalSection(&sessions_mutex); #ifdef DEBUGMODE debugLogA("~GGPROTO(): DeleteCriticalSections. OK"); #endif // Free status messages if (modemsg.online) mir_free(modemsg.online); if (modemsg.away) mir_free(modemsg.away); if (modemsg.dnd) mir_free(modemsg.dnd); if (modemsg.freechat) mir_free(modemsg.freechat); if (modemsg.invisible) mir_free(modemsg.invisible); if (modemsg.offline) mir_free(modemsg.offline); }