mmi-manager: fix not to do duplicated init/shutdown 32/264032/1
authorSung-Jin Park <sj76.park@samsung.com>
Mon, 19 Jul 2021 15:14:30 +0000 (00:14 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Mon, 13 Sep 2021 11:24:20 +0000 (20:24 +0900)
Change-Id: I80218bc5e3917b4ad0995dc36e7f2713c263018e
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/mmi-manager.c

index 70f8855..3477ed4 100644 (file)
@@ -30,6 +30,9 @@
 #include "mmi-api-handler.h"
 
 #include <Ecore.h>
+#include <Eina.h>
+
+static Eina_Bool _init_done = false;
 
 int
 mmi_manager_get_focus(mmi_client *client)
@@ -53,12 +56,17 @@ mmi_manager_set_state(mmi_client *client, mmi_state state)
 void
 mmi_manager_init()
 {
+       if (_init_done)
+               return;
+
        ecore_init();
        mmi_core_init();
        modality_providers_init();
        modality_fusions_init();
        client_manager_init();
        mmi_api_handler_init();
+
+       _init_done = true;
 }
 
 void
@@ -76,10 +84,14 @@ mmi_manager_loop_end()
 void
 mmi_manager_shutdown()
 {
+       if (!_init_done)
+               return;
        mmi_api_handler_shutdown();
        client_manager_shutdown();
        modality_fusions_shutdown();
        modality_providers_shutdown();
        mmi_core_shutdown();
        ecore_shutdown();
+
+       _init_done = false;
 }