Unload default global config module when APP is exiting 85/33585/1
authorLi Zhang <li2012.zhang@samsung.com>
Wed, 27 Aug 2014 11:57:40 +0000 (19:57 +0800)
committerLi Zhang <li2012.zhang@samsung.com>
Tue, 13 Jan 2015 08:28:01 +0000 (16:28 +0800)
Change-Id: Ic5b2b2c124a3c90805a7edef8271ae37c29ee16a

ism/extras/efl_immodule/isf_imf_context.cpp
ism/src/scim_config_base.cpp
ism/src/scim_config_base.h
ism/src/scim_config_module.cpp
ism/src/scim_config_module.h
ism/src/scim_helper_launcher.cpp

index 6089ad2..003d363 100644 (file)
@@ -3403,7 +3403,8 @@ finalize (void)
     SCIM_DEBUG_FRONTEND(2) << " Releasing Config...\n";
     _config.reset ();
     _config_connection.disconnect ();
-
+    ConfigBase::set (0);
+    ConfigBase::unload ();
     _focused_ic = NULL;
     _ic_list = NULL;
 
index bfefda3..dc0a617 100644 (file)
@@ -178,6 +178,12 @@ ConfigBase::get (bool create_on_demand, const String &default_module)
     return _scim_default_config;
 }
 
+void
+ConfigBase::unload ()
+{
+    _scim_default_config_module.unload ();
+}
+
 /*
  * Implementation of DummyConfig
  */
index ec4ab6d..b31c2e6 100644 (file)
@@ -365,6 +365,13 @@ public:
      */
     static ConfigPointer get (bool create_on_demand = true,
                               const String &default_module = String (""));
+    /**
+     * @brief Unload the default global Config module.
+     *
+     * If global Config object is used by calling function ConfigBase::get
+     * ConfigBase::unload is needed before exit.
+     */
+    static void unload ();
 };
 
 /**
index a834212..1b1a081 100644 (file)
@@ -72,6 +72,12 @@ ConfigModule::load (const String &name)
 }
 
 bool
+ConfigModule::unload ()
+{
+    return m_module.unload ();
+}
+
+bool
 ConfigModule::valid () const
 {
     return (m_module.valid () && m_config_init && m_config_create_config);
index 353cb2e..ec962c6 100644 (file)
@@ -104,6 +104,12 @@ public:
     bool load  (const String &name);
 
     /**
+     * @brief Unload the config Module.
+     * @return true if sucessfully unloaded.
+     */
+    bool unload ();
+
+    /**
      * @brief Check if a module is loaded and initialized successfully.
      * @return true if a module is already loaded and initialized successfully.
      */
index 7cf0bc6..ff8f534 100644 (file)
@@ -201,6 +201,7 @@ int main (int argc, char *argv [])
     if (!config_pointer.null ())
         config_pointer.reset ();
     ConfigBase::set (0);
+    ConfigBase::unload ();
     snprintf (buf, sizeof (buf), "time:%ld  pid:%d  %s  %s  Helper ISE (%s) is destroyed!!!\n",
         time (0), getpid (), __FILE__, __func__, uuid.c_str ());
     isf_save_log (buf);