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/Dbx_mdbx/src/dbintf.cpp | 1 + plugins/Dbx_mdbx/src/init.cpp | 10 +--------- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'plugins/Dbx_mdbx/src') diff --git a/plugins/Dbx_mdbx/src/dbintf.cpp b/plugins/Dbx_mdbx/src/dbintf.cpp index e74f266248..e9d0b33ad9 100644 --- a/plugins/Dbx_mdbx/src/dbintf.cpp +++ b/plugins/Dbx_mdbx/src/dbintf.cpp @@ -39,6 +39,7 @@ CDbxMDBX::CDbxMDBX(const TCHAR *tszFileName, int iMode) : CDbxMDBX::~CDbxMDBX() { + g_Dbs.remove(this); mdbx_env_close(m_env); DestroyServiceFunction(hService); diff --git a/plugins/Dbx_mdbx/src/init.cpp b/plugins/Dbx_mdbx/src/init.cpp index bfb04f23ae..3e7153e6db 100644 --- a/plugins/Dbx_mdbx/src/init.cpp +++ b/plugins/Dbx_mdbx/src/init.cpp @@ -62,7 +62,7 @@ static int grokHeader(const TCHAR *profile) } // returns 0 if all the APIs are injected otherwise, 1 -static MIDatabase* LoadDatabase(const TCHAR *profile, BOOL bReadOnly) +static MDatabaseCommon* LoadDatabase(const TCHAR *profile, BOOL bReadOnly) { // set the memory, lists & UTF8 manager mir_getLP(&pluginInfo); @@ -75,13 +75,6 @@ static MIDatabase* LoadDatabase(const TCHAR *profile, BOOL bReadOnly) return db.release(); } -static int UnloadDatabase(MIDatabase *db) -{ - g_Dbs.remove((CDbxMDBX*)db); - delete (CDbxMDBX*)db; - return 0; -} - MIDatabaseChecker* CheckDb(const TCHAR *profile, int *error) { std::unique_ptr db(new CDbxMDBX(profile, DBMODE_READONLY)); @@ -101,7 +94,6 @@ static DATABASELINK dblink = makeDatabase, grokHeader, LoadDatabase, - UnloadDatabase, CheckDb }; -- cgit v1.2.3