summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-08-24 04:56:57 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-08-24 04:56:57 +0200
commit95f644532e056907df37d587a790c9754182017e (patch)
tree2d6ce51d1ffa2338545dbd54acacc306ea8036bd /src
parentdcfbdc5844474ef8e577d5f1c2bfd2e71c43e5fc (diff)
downloadabrt-95f644532e056907df37d587a790c9754182017e.tar.gz
abrt-95f644532e056907df37d587a790c9754182017e.tar.xz
abrt-95f644532e056907df37d587a790c9754182017e.zip
move CMiddleWare initialized/finalizer into its sole user
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r--src/Daemon/Daemon.cpp11
-rw-r--r--src/Daemon/MiddleWare.cpp18
-rw-r--r--src/Daemon/MiddleWare.h19
3 files changed, 18 insertions, 30 deletions
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp
index 2911a402..90bf6056 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;
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp
index c3a362ab..9fff5b0e 100644
--- a/src/Daemon/MiddleWare.cpp
+++ b/src/Daemon/MiddleWare.cpp
@@ -61,28 +61,14 @@ static vector_pair_string_string_t m_vectorActionsAndReporters;
/**
* Check GPG finger print?
*/
-static bool m_bOpenGPGCheck;
+static bool m_bOpenGPGCheck = true;
static void RunAnalyzerActions(const std::string& pAnalyzer, const std::string& pDebugDumpDir);
-void CMiddleWare(const std::string& pPluginsConfDir,
- const std::string& pPluginsLibDir)
-{
- m_bOpenGPGCheck = true;
- g_pPluginManager = new CPluginManager(pPluginsConfDir, pPluginsLibDir);
- g_pPluginManager->LoadPlugins();
-}
-
-void CMiddleWare_deinit()
-{
- g_pPluginManager->UnLoadPlugins();
- delete g_pPluginManager;
-}
-
/**
- * A method, which transforms a debugdump direcortry to inner crash
+ * Transforms a debugdump direcortry to inner crash
* report form. This form is used for later reporting.
* @param pDebugDumpDir A debugdump dir containing all necessary data.
* @param pCrashReport A created crash report.
diff --git a/src/Daemon/MiddleWare.h b/src/Daemon/MiddleWare.h
index d744f5d6..ef49c233 100644
--- a/src/Daemon/MiddleWare.h
+++ b/src/Daemon/MiddleWare.h
@@ -60,11 +60,8 @@ typedef std::map<std::string, vector_pair_string_string_t> map_analyzer_actions_
extern CPluginManager* g_pPluginManager;
-void CMiddleWare(const std::string& pPluginsConfDir,
- const std::string& pPluginsLibDir);
-void CMiddleWare_deinit();
/**
- * A method, which takes care of getting all additional data needed
+ * Takes care of getting all additional data needed
* for computing UUIDs and creating a report for particular analyzer
* plugin. This report could be send somewhere afterwards. If a creation
* is successful, then a crash report is filled.
@@ -77,7 +74,7 @@ mw_result_t CreateCrashReport(const std::string& pUUID,
const std::string& pUID,
map_crash_report_t& pCrashReport);
/**
- * A method, which activate particular action plugin.
+ * Activates particular action plugin.
* @param pActionDir A directory, which is passed as working to a action plugin.
* @param pPluginName An action plugin name.
* @param pPluginArgs Action plugin's arguments.
@@ -86,13 +83,13 @@ void RunAction(const std::string& pActionDir,
const std::string& pPluginName,
const std::string& pPluginArgs);
/**
- * A method, which activate all action and reporter plugins when any
+ * Activates all action and reporter plugins when any
* crash occurs.
* @param pDebugDumpDir A debugdump dir containing all necessary data.
*/
void RunActionsAndReporters(const std::string& pDebugDumpDir);
/**
- * A method, which reports a crash report to particular receiver. It
+ * Reports a crash report to particular receiver. It
* takes an user uid, tries to find user config file and load it. If it
* fails, then default config is used. If pUID is emply string, default
* config is used.
@@ -104,12 +101,12 @@ void RunActionsAndReporters(const std::string& pDebugDumpDir);
report_status_t Report(const map_crash_report_t& pCrashReport,
const std::string& pUID);
/**
- * A method, which deletes particular debugdump directory.
+ * Deletes particular debugdump directory.
* @param pDebugDumpDir A debugdump directory.
*/
void DeleteDebugDumpDir(const std::string& pDebugDumpDir);
/**
- * A method, which delete a row from database. If a deleting is
+ * Deletes a row from database. If a deleting is
* successfull, it returns a debugdump directort, which is not
* deleted. Otherwise, it returns empty string.
* @param pUUID A local UUID of a crash.
@@ -119,13 +116,13 @@ void DeleteDebugDumpDir(const std::string& pDebugDumpDir);
std::string DeleteCrashInfo(const std::string& pUUID,
const std::string& pUID);
/**
- * A method, whis saves debugdump into database.
+ * Saves debugdump into database.
* @param pDebugDumpDir A debugdump directory.
* @return It return results of operation. See mw_result_t.
*/
mw_result_t SaveDebugDump(const std::string& pDebugDumpDir);
/**
- * A method, whis saves debugdump into database. If saving is sucessful
+ * Saves debugdump into database. If saving is sucessful
* it fills crash info.
* @param pDebugDumpDir A debugdump directory.
* @param pCrashInfo A crash info.