summaryrefslogtreecommitdiff
path: root/src/modules/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-01-04 10:49:52 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-01-04 10:49:52 +0000
commit1e20b1b154d9716f9ff9fcc9c4398eb3f5762bf1 (patch)
tree9d10e16ffafe8af279955165b92e3e0b16ac5339 /src/modules/plugins
parentb5ed6609e84c1ad21d29a8f2e3c490b6ccfcbe1d (diff)
fatal error to be issued any time we can't load a Std* plugin
git-svn-id: http://svn.miranda-ng.org/main/trunk@11764 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/plugins')
-rw-r--r--src/modules/plugins/newplugins.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index f30efaa103..5c16845279 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -149,12 +149,8 @@ int LoadStdPlugins()
if (pluginDefault[i].pImpl)
continue;
- if (!LoadCorePlugin(pluginDefault[i])) {
- TCHAR tszBuf[512];
- mir_sntprintf(tszBuf, SIZEOF(tszBuf), TranslateT("Core plugin '%s' cannot be loaded or missing. Miranda will exit now"), pluginDefault[i].stdplugname);
- MessageBox(NULL, tszBuf, TranslateT("Fatal error"), MB_OK | MB_ICONSTOP);
+ if (!LoadCorePlugin(pluginDefault[i]))
return 1;
- }
}
if (pluginDefault[13].pImpl == NULL)
@@ -543,6 +539,11 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic)
return true;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// Core plugins support
+
+static TCHAR tszCoreErr[] = LPGENT("Core plugin '%s' cannot be loaded or missing. Miranda will exit now");
+
bool LoadCorePlugin(MuuidReplacement& mr)
{
TCHAR exe[MAX_PATH], tszPlugName[MAX_PATH];
@@ -553,6 +554,8 @@ bool LoadCorePlugin(MuuidReplacement& mr)
pluginEntry* pPlug = OpenPlugin(tszPlugName, _T("Core"), exe);
if (pPlug->pclass & PCLASS_FAILED) {
LBL_Error:
+ MessageBox(NULL, CMString(FORMAT, TranslateTS(tszCoreErr), mr.stdplugname), TranslateT("Fatal error"), MB_OK | MB_ICONSTOP);
+
Plugin_UnloadDyn(pPlug);
mr.pImpl = NULL;
return false;