From a4498f183c28fb10af04e94d1236b795b06bf7a5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 8 Mar 2013 20:55:34 +0000 Subject: some memory leak fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@3925 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/modules.cpp | 16 ++++++++++------ src/modules/database/database.h | 2 +- src/modules/database/dbintf.cpp | 8 +++++++- 3 files changed, 18 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/core/modules.cpp b/src/core/modules.cpp index d06858a6c9..1eb92eab3c 100644 --- a/src/core/modules.cpp +++ b/src/core/modules.cpp @@ -66,21 +66,23 @@ int LoadDefaultServiceModePlugin(void); int LoadErrorsModule(void); int LoadStdPlugins(void); -void UnloadUtilsModule(void); +void UnloadAccountsModule(void); void UnloadButtonModule(void); void UnloadClcModule(void); void UnloadContactListModule(void); void UnloadDatabase(void); +void UnloadDbintfModule(void); +void UnloadErrorsModule(void); void UnloadEventsModule(void); -void UnloadSslModule(void); +void UnloadExtraIconsModule(void); +void UnloadIcoLibModule(void); void UnloadNetlibModule(void); void UnloadNewPlugins(void); -void UnloadIcoLibModule(void); +void UnloadProtocolsModule(void); void UnloadSkinSounds(void); void UnloadSkinHotkeys(void); -void UnloadProtocolsModule(void); -void UnloadAccountsModule(void); -void UnloadErrorsModule(void); +void UnloadSslModule(void); +void UnloadUtilsModule(void); int LoadIcoTabsModule(); int LoadHeaderbarModule(); @@ -171,10 +173,12 @@ void UnloadDefaultModules(void) // UnloadErrorsModule(); UnloadIcoLibModule(); UnloadUtilsModule(); + UnloadExtraIconsModule(); UnloadButtonModule(); UnloadClcModule(); UnloadContactListModule(); UnloadEventsModule(); UnloadNetlibModule(); + UnloadDbintfModule(); UnloadSslModule(); } diff --git a/src/modules/database/database.h b/src/modules/database/database.h index eefdd3217c..e484d341e5 100644 --- a/src/modules/database/database.h +++ b/src/modules/database/database.h @@ -21,7 +21,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -class MDatabaseCache : public MIDatabaseCache, public MZeroedObject +class MDatabaseCache : public MIDatabaseCache { HANDLE m_hCacheHeap; char* m_lastSetting; diff --git a/src/modules/database/dbintf.cpp b/src/modules/database/dbintf.cpp index 70d033c50c..e95caff6c4 100644 --- a/src/modules/database/dbintf.cpp +++ b/src/modules/database/dbintf.cpp @@ -232,8 +232,9 @@ static INT_PTR srvDestroyInstance(WPARAM wParam,LPARAM lParam) { MIDatabase* pDb = (MIDatabase*)lParam; if (pDb != NULL) { - delete pDb->m_cache; + MDatabaseCache *pCache = (MDatabaseCache*)pDb->m_cache; pDb->m_cache = NULL; + delete pCache; } return 0; } @@ -284,3 +285,8 @@ int LoadDbintfModule() CreateServiceFunction(MS_DB_DESTROY_INSTANCE, srvDestroyInstance); return 0; } + +void UnloadDbintfModule() +{ + arDbPlugins.destroy(); +} -- cgit v1.2.3