e_info: add cleanup function for module_hook 78/133378/2
authorJengHyun Kang <jhyuni.kang@samsung.com>
Mon, 12 Jun 2017 04:16:41 +0000 (13:16 +0900)
committerJeongHyun Kang <jhyuni.kang@samsung.com>
Mon, 12 Jun 2017 04:19:02 +0000 (04:19 +0000)
Change-Id: I3d2540cc97eabab1b64f044819374c16d53ed7e7

src/bin/e_info_server.c

index 370d5f3..9b8b698 100644 (file)
@@ -3017,6 +3017,18 @@ _e_info_server_module_hook_call(const char *module_name, const char *log_path)
      }
 }
 
+static void
+_e_info_server_module_hook_cleanup(void)
+{
+   E_Info_Hook *hdata;
+
+   EINA_LIST_FREE(module_hook, hdata)
+     {
+        eina_stringshare_del(hdata->module_name);
+        E_FREE(hdata);
+     }
+}
+
 /* a hook with given name(module_name) is defined by plug-in modules*/
 E_API void
 e_info_server_hook_set(const char *module_name, E_Info_Hook_Cb func, void *data)
@@ -5040,6 +5052,8 @@ e_info_server_shutdown(void)
    e_info_dump_count = 0;
    e_info_dump_running = 0;
 
+   if (module_hook) _e_info_server_module_hook_cleanup();
+
    e_info_protocol_shutdown();
 
    eldbus_shutdown();