summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-21 18:06:27 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-21 18:09:19 +0300
commitf7001757a832e948645713a94739f66b07d5f2c1 (patch)
tree8accc928f2eadf5940a336f9be639b3f27e921a6 /plugins/Dbx_mdbx
parent6119b7865f7890d9bfc627d35d8e1262c2690e9c (diff)
DATABASELINK::Unload method replaced with the virtual destructor of MDatabaseCommon
Diffstat (limited to 'plugins/Dbx_mdbx')
-rw-r--r--plugins/Dbx_mdbx/src/dbintf.cpp1
-rw-r--r--plugins/Dbx_mdbx/src/init.cpp10
2 files changed, 2 insertions, 9 deletions
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<CDbxMDBX> db(new CDbxMDBX(profile, DBMODE_READONLY));
@@ -101,7 +94,6 @@ static DATABASELINK dblink =
makeDatabase,
grokHeader,
LoadDatabase,
- UnloadDatabase,
CheckDb
};