diff options
Diffstat (limited to 'plugins/Dbx_mdbx/src/init.cpp')
| -rw-r--r-- | plugins/Dbx_mdbx/src/init.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/Dbx_mdbx/src/init.cpp b/plugins/Dbx_mdbx/src/init.cpp index 1fd64d825b..f90995b02c 100644 --- a/plugins/Dbx_mdbx/src/init.cpp +++ b/plugins/Dbx_mdbx/src/init.cpp @@ -43,15 +43,13 @@ static PLUGININFOEX pluginInfo = HINSTANCE g_hInst = nullptr;
-LIST<CDbxMDBX> g_Dbs(1, HandleKeySortT);
-
/////////////////////////////////////////////////////////////////////////////////////////
// returns 0 if the profile is created, EMKPRF*
static int makeDatabase(const TCHAR *profile)
{
std::unique_ptr<CDbxMDBX> db(new CDbxMDBX(profile, 0));
- return db->Create();
+ return (db->Map() == MDBX_SUCCESS) ? 0 : EGROKPRF_CANTREAD;
}
// returns 0 if the given profile has a valid header
@@ -68,10 +66,12 @@ static MDatabaseCommon* LoadDatabase(const TCHAR *profile, BOOL bReadOnly) mir_getLP(&pluginInfo);
std::unique_ptr<CDbxMDBX> db(new CDbxMDBX(profile, (bReadOnly) ? DBMODE_READONLY : 0));
- if (db->Load(false) != ERROR_SUCCESS)
+ if (db->Map() != ERROR_SUCCESS)
+ return nullptr;
+
+ if (db->Load() != ERROR_SUCCESS)
return nullptr;
- g_Dbs.insert(db.get());
return db.release();
}
|
