From f7001757a832e948645713a94739f66b07d5f2c1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 21 Mar 2018 18:06:27 +0300 Subject: DATABASELINK::Unload method replaced with the virtual destructor of MDatabaseCommon --- plugins/Db3x_mmap/src/dbintf.cpp | 2 ++ plugins/Db3x_mmap/src/init.cpp | 9 +-------- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'plugins/Db3x_mmap/src') diff --git a/plugins/Db3x_mmap/src/dbintf.cpp b/plugins/Db3x_mmap/src/dbintf.cpp index dc775b82b1..be36e4bdd7 100644 --- a/plugins/Db3x_mmap/src/dbintf.cpp +++ b/plugins/Db3x_mmap/src/dbintf.cpp @@ -59,6 +59,8 @@ CDb3Mmap::CDb3Mmap(const wchar_t *tszFileName, int iMode) : CDb3Mmap::~CDb3Mmap() { + g_Dbs.remove(this); + // destroy modules HeapDestroy(m_hModHeap); diff --git a/plugins/Db3x_mmap/src/init.cpp b/plugins/Db3x_mmap/src/init.cpp index 21feb9ed49..a452a43321 100644 --- a/plugins/Db3x_mmap/src/init.cpp +++ b/plugins/Db3x_mmap/src/init.cpp @@ -67,6 +67,7 @@ static int grokHeader(const wchar_t *profile) // returns 0 if all the APIs are injected otherwise, 1 static MIDatabase* LoadDatabase(const wchar_t *profile, BOOL bReadOnly) +static MDatabaseCommon* LoadDatabase(const wchar_t *profile, BOOL bReadOnly) { // set the memory, lists & UTF8 manager mir_getLP(&pluginInfo); @@ -79,13 +80,6 @@ static MIDatabase* LoadDatabase(const wchar_t *profile, BOOL bReadOnly) return db.release(); } -static int UnloadDatabase(MIDatabase *db) -{ - g_Dbs.remove((CDb3Mmap*)db); - delete (CDb3Mmap*)db; - return 0; -} - MIDatabaseChecker* CheckDb(const wchar_t *profile, int *error) { std::auto_ptr db(new CDb3Mmap(profile, DBMODE_READONLY)); @@ -108,7 +102,6 @@ static DATABASELINK dblink = makeDatabase, grokHeader, LoadDatabase, - UnloadDatabase, CheckDb }; -- cgit v1.2.3