diff --git a/apps/xmlrpc2di/XMLRPC2DI.cpp b/apps/xmlrpc2di/XMLRPC2DI.cpp index 56e8d106..c8a35b73 100644 --- a/apps/xmlrpc2di/XMLRPC2DI.cpp +++ b/apps/xmlrpc2di/XMLRPC2DI.cpp @@ -66,7 +66,7 @@ XMLRPC2DI* XMLRPC2DI::instance() return _instance; } -XMLRPC2DI::XMLRPC2DI(const string& mod_name) +XMLRPC2DI::XMLRPC2DI(const string& mod_name) : AmDynInvokeFactory(mod_name) { } @@ -348,7 +348,8 @@ XMLRPC2DIServer::XMLRPC2DIServer(unsigned int port, getcpsavg_method(s), getcpsmax_method(s), getcpslimit_method(s), - setcpslimit_method(s) + setcpslimit_method(s), + s(NULL), di_method(NULL) { INFO("XMLRPC Server: enabled builtin method 'calls'\n"); INFO("XMLRPC Server: enabled builtin method 'get_loglevel'\n"); diff --git a/apps/xmlrpc2di/XMLRPC2DI.h b/apps/xmlrpc2di/XMLRPC2DI.h index b2126b42..9ac1f7fe 100644 --- a/apps/xmlrpc2di/XMLRPC2DI.h +++ b/apps/xmlrpc2di/XMLRPC2DI.h @@ -134,6 +134,15 @@ class XMLRPC2DIServer bool multithreaded = false, unsigned int threads = 5); + ~XMLRPC2DIServer() { + if (s) { + delete s; + } + if (di_method) { + delete di_method; + } + } + bool initialize(); void run(); @@ -188,7 +197,11 @@ class XMLRPC2DI public: XMLRPC2DI(const string& mod_name); - ~XMLRPC2DI() { } + ~XMLRPC2DI() { + if (server) { + delete server; + } + } int onLoad(); // DI factory