From 8db272850a6e89689424eb3058e833511ee64232 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 30 Jul 2012 07:16:51 +0000 Subject: service plugin's launcher in Profile Manager always launches DbChecker git-svn-id: http://svn.miranda-ng.org/main/trunk@1270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/plugins/newplugins.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/modules/plugins') diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp index f583b2aa09..359b2705e3 100644 --- a/src/modules/plugins/newplugins.cpp +++ b/src/modules/plugins/newplugins.cpp @@ -632,18 +632,26 @@ int LoadServiceModePlugin() return (serviceModePlugin == NULL) ? SERVICE_CONTINUE : LaunchServicePlugin(serviceModePlugin); } -void EnsureCheckerLoaded(void) +void EnsureCheckerLoaded(bool bEnable) { for (int i=0; i < servicePlugins.getCount(); i++) { pluginEntry* p = servicePlugins[i]; if ( _tcsicmp(p->pluginname, _T("dbchecker.dll"))) continue; - if ( !(p->pclass & PCLASS_LOADED)) { - if (p->bpi.Load() != ERROR_SUCCESS) - Plugin_Uninit(p); - else - p->pclass |= PCLASS_LOADED; + if (bEnable) { + if ( !(p->pclass & PCLASS_LOADED)) { + if (p->bpi.Load() != ERROR_SUCCESS) + Plugin_Uninit(p); + else + p->pclass |= PCLASS_LOADED; + } + } + else { + if (p->pclass & PCLASS_LOADED) { + p->bpi.Unload(); + p->pclass &= ~PCLASS_LOADED; + } } break; } -- cgit v1.2.3