From: Li Zhang Date: Wed, 27 Aug 2014 11:57:40 +0000 (+0800) Subject: Unload default global config module when APP is exiting X-Git-Tag: submit/tizen/20150128.083920~120 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a29c07b8f609349014e1483263c09ef0092f83ca;p=platform%2Fcore%2Fuifw%2Fisf.git Unload default global config module when APP is exiting Change-Id: Ic5b2b2c124a3c90805a7edef8271ae37c29ee16a --- diff --git a/ism/extras/efl_immodule/isf_imf_context.cpp b/ism/extras/efl_immodule/isf_imf_context.cpp index 6089ad2..003d363 100644 --- a/ism/extras/efl_immodule/isf_imf_context.cpp +++ b/ism/extras/efl_immodule/isf_imf_context.cpp @@ -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; diff --git a/ism/src/scim_config_base.cpp b/ism/src/scim_config_base.cpp index bfefda3..dc0a617 100644 --- a/ism/src/scim_config_base.cpp +++ b/ism/src/scim_config_base.cpp @@ -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 */ diff --git a/ism/src/scim_config_base.h b/ism/src/scim_config_base.h index ec4ab6d..b31c2e6 100644 --- a/ism/src/scim_config_base.h +++ b/ism/src/scim_config_base.h @@ -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 (); }; /** diff --git a/ism/src/scim_config_module.cpp b/ism/src/scim_config_module.cpp index a834212..1b1a081 100644 --- a/ism/src/scim_config_module.cpp +++ b/ism/src/scim_config_module.cpp @@ -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); diff --git a/ism/src/scim_config_module.h b/ism/src/scim_config_module.h index 353cb2e..ec962c6 100644 --- a/ism/src/scim_config_module.h +++ b/ism/src/scim_config_module.h @@ -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. */ diff --git a/ism/src/scim_helper_launcher.cpp b/ism/src/scim_helper_launcher.cpp index 7cf0bc6..ff8f534 100644 --- a/ism/src/scim_helper_launcher.cpp +++ b/ism/src/scim_helper_launcher.cpp @@ -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);