From 95f644532e056907df37d587a790c9754182017e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 24 Aug 2009 04:56:57 +0200 Subject: move CMiddleWare initialized/finalizer into its sole user Signed-off-by: Denys Vlasenko --- src/Daemon/Daemon.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/Daemon/Daemon.cpp') diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 2911a40..90bf605 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -596,7 +596,8 @@ int main(int argc, char** argv) /* (comment here) */ g_pMainloop = g_main_loop_new(NULL, FALSE); /* (comment here) */ - CMiddleWare(PLUGINS_CONF_DIR, PLUGINS_LIB_DIR); + g_pPluginManager = new CPluginManager(PLUGINS_CONF_DIR, PLUGINS_LIB_DIR); + g_pPluginManager->LoadPlugins(); SetUpMW(); SetUpCron(); FindNewDumps(DEBUG_DUMPS_DIR); @@ -631,7 +632,9 @@ int main(int argc, char** argv) g_io_channel_unref(pGio); delete g_pCommLayer; /* This restores /proc/sys/kernel/core_pattern, among other things: */ - CMiddleWare_deinit(); + g_pPluginManager->UnLoadPlugins(); + delete g_pPluginManager; + g_main_loop_unref(g_pMainloop); delete g_pSettings; if (pthread_mutex_destroy(&g_pJobsMutex) != 0) @@ -669,7 +672,9 @@ int main(int argc, char** argv) g_io_channel_unref(pGio); delete g_pCommLayer; /* This restores /proc/sys/kernel/core_pattern, among other things: */ - CMiddleWare_deinit(); + g_pPluginManager->UnLoadPlugins(); + delete g_pPluginManager; + g_main_loop_unref(g_pMainloop); delete g_pSettings; -- cgit