summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src
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/Db3x_mmap/src
parent6119b7865f7890d9bfc627d35d8e1262c2690e9c (diff)
DATABASELINK::Unload method replaced with the virtual destructor of MDatabaseCommon
Diffstat (limited to 'plugins/Db3x_mmap/src')
-rw-r--r--plugins/Db3x_mmap/src/dbintf.cpp2
-rw-r--r--plugins/Db3x_mmap/src/init.cpp9
2 files changed, 3 insertions, 8 deletions
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<CDb3Mmap> db(new CDb3Mmap(profile, DBMODE_READONLY));
@@ -108,7 +102,6 @@ static DATABASELINK dblink =
makeDatabase,
grokHeader,
LoadDatabase,
- UnloadDatabase,
CheckDb
};