summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/commonheaders.h5
-rw-r--r--core/main.cpp18
-rw-r--r--core/modules.cpp15
3 files changed, 37 insertions, 1 deletions
diff --git a/core/commonheaders.h b/core/commonheaders.h
index 1bf5866..5cca301 100644
--- a/core/commonheaders.h
+++ b/core/commonheaders.h
@@ -3,9 +3,12 @@
#include <list>
-
+
+//boost
#include <boost/thread.hpp>
#include <boost/filesystem.hpp>
+#include <boost/shared_ptr.hpp>
+//ACE
#include <ace/ACE.h>
#include <ace/DLL.h>
#include <ace/OS_main.h>
diff --git a/core/main.cpp b/core/main.cpp
index 13de647..5a27e20 100644
--- a/core/main.cpp
+++ b/core/main.cpp
@@ -38,3 +38,21 @@ int ACE_MAIN(int argc, char *argv[])
}
+int on_exit()
+{
+ if(!services.empty())
+ {
+ std::list<service*>::iterator end = services.end();
+ for(std::list<service*>::iterator i = services.begin(); i != end; ++i)
+ delete *i;
+ services.clear();
+ }
+ if(!plugins.empty())
+ {
+ std::list<plugin*>::iterator end = plugins.end();
+ for(std::list<plugin*>::iterator i = plugins.begin(); i != end; ++i)
+ delete *i;
+ plugins.clear();
+ }
+ return 0;
+} \ No newline at end of file
diff --git a/core/modules.cpp b/core/modules.cpp
index 6518825..5b5186b 100644
--- a/core/modules.cpp
+++ b/core/modules.cpp
@@ -68,11 +68,26 @@ plugin::plugin(ACE_DLL *lib, PLUGININFO *info, exported_functions_s *funcs)
{
if(lib)
plug = lib;
+ else
+ plug = NULL;
if(info)
plugininfo = info;
+ else
+ plugininfo = NULL;
if(funcs)
exported_funcs = funcs;
+ else
+ exported_funcs = NULL;
}
+
+plugin::~plugin()
+{
+ if(plug)
+ delete plug;
+ if(exported_funcs)
+ delete exported_funcs;
+}
+
const plugin::exported_functions_s* plugin::get_exported_functions()
{
return exported_funcs;