Module: sems
Branch: master
Commit: 0b2c8068a980058ff34655bc4928aeaedbe527d7
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=0b2c8068a980058ff34655bc4928aeaedbe527d7

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Thu Jan  5 22:10:52 2012 +0100

b/f: don't delete registered app objects, e.g. DSM apps

fixes bug #68
https://bugtracker.iptel.org/view.php?id=68

---

 core/AmPlugIn.cpp |    3 ++-
 core/AmPlugIn.h   |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/core/AmPlugIn.cpp b/core/AmPlugIn.cpp
index 99bbdef..a3214d8 100644
--- a/core/AmPlugIn.cpp
+++ b/core/AmPlugIn.cpp
@@ -128,7 +128,7 @@ static void delete_plugin_factory(std::pair<string, 
AmPluginFactory*> pf)
 
 AmPlugIn::~AmPlugIn()
 {
-  std::for_each(name2app.begin(), name2app.end(), delete_plugin_factory);
+  std::for_each(module_objects.begin(), module_objects.end(), 
delete_plugin_factory);
   std::for_each(name2seh.begin(), name2seh.end(), delete_plugin_factory);
   std::for_each(name2base.begin(), name2base.end(), delete_plugin_factory);
   std::for_each(name2di.begin(), name2di.end(), delete_plugin_factory);
@@ -609,6 +609,7 @@ int AmPlugIn::loadAppPlugIn(AmPluginFactory* f)
   name2app.insert(std::make_pair(sf->getName(),sf));
   DBG("application '%s' loaded.\n",sf->getName().c_str());
 
+  module_objects.insert(std::make_pair(sf->getName(),sf));
   name2app_mut.unlock();
 
   return 0;
diff --git a/core/AmPlugIn.h b/core/AmPlugIn.h
index 2d0c661..2c418c0 100644
--- a/core/AmPlugIn.h
+++ b/core/AmPlugIn.h
@@ -104,6 +104,8 @@ class AmPlugIn : public AmPayloadProvider
   std::map<string,AmDynInvokeFactory*>           name2di;
   std::map<string,AmLoggingFacility*>            name2logfac;
 
+  std::map<string,AmPluginFactory*>             module_objects;
+
   //AmCtrlInterfaceFactory *ctrlIface;
 
   int dynamic_pl; // range: 96->127, see RFC 1890

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to