summaryrefslogtreecommitdiffstats
path: root/lib/MiddleWare
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-07-31 15:13:38 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-07-31 15:13:38 +0200
commite60c006499ec9a1604f85f84a98145535a7ad0a7 (patch)
tree8697c803a43e1b0a0bba0e7f2cb3d05573baa683 /lib/MiddleWare
parentf9a9c1ddeaff8e0fc6e1c5b1fb323c4da4763401 (diff)
Move PLUGIN_INFOs to .cpp files: same object must never be defined twice
and if structure is defined in a .h file, that happens. Since this particular structure has non-trivial destructor, it was running twice and resulted in double-free. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/MiddleWare')
-rw-r--r--lib/MiddleWare/Plugin.h15
-rw-r--r--lib/MiddleWare/PluginManager.cpp6
2 files changed, 12 insertions, 9 deletions
diff --git a/lib/MiddleWare/Plugin.h b/lib/MiddleWare/Plugin.h
index ef107e3..c7ae9ce 100644
--- a/lib/MiddleWare/Plugin.h
+++ b/lib/MiddleWare/Plugin.h
@@ -60,15 +60,12 @@ class CPlugin
/**
* An emun of plugin types.
*/
-typedef enum { ANALYZER, /**< An analyzer plugin*/
- ACTION, /**< An action plugin*/
- REPORTER, /**< A reporter plugin*/
- DATABASE /**< A database plugin*/
- } plugin_type_t;
-/**
- * Text reprezentation of plugin types.
- */
-const char* const plugin_type_str_t[] = {"Analyzer", "Action", "Reporter", "Database"};
+typedef enum {
+ ANALYZER, /**< An analyzer plugin*/
+ ACTION, /**< An action plugin*/
+ REPORTER, /**< A reporter plugin*/
+ DATABASE /**< A database plugin*/
+} plugin_type_t;
/**
* A struct contains all needed data about particular plugin.
diff --git a/lib/MiddleWare/PluginManager.cpp b/lib/MiddleWare/PluginManager.cpp
index 916eabe..2d11093 100644
--- a/lib/MiddleWare/PluginManager.cpp
+++ b/lib/MiddleWare/PluginManager.cpp
@@ -27,6 +27,12 @@
#include <stdio.h>
#include <sys/types.h>
+/**
+ * Text reprezentation of plugin types.
+ */
+static const char* const plugin_type_str_t[] = { "Analyzer", "Action", "Reporter", "Database" };
+
+
CPluginManager::CPluginManager(const std::string& pPlugisConfDir,
const std::string& pPlugisLibDir) :
m_sPlugisConfDir(pPlugisConfDir),