Keep toolkit_table before callback removed_cb 69/147269/2
authorSemun Lee <semun.lee@samsung.com>
Sun, 3 Sep 2017 11:00:58 +0000 (20:00 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Mon, 4 Sep 2017 07:22:41 +0000 (07:22 +0000)
toolkit_evas_h can be freed in removed_cb

Change-Id: Id28a1661441b3e327216ca6a37175e4000caf034
Signed-off-by: Semun Lee <semun.lee@samsung.com>
screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c

index 18606d3..0812e0e 100644 (file)
@@ -1007,6 +1007,7 @@ static void __toolkit_removed_cb(const char *appid, const char *instance_id, con
 {
        screen_connector_toolkit_evas_h toolkit_evas_h;
        char *plug_id;
+       GHashTable *toolkit_table;
 
        LOGD("missing %s %s", appid, instance_id);
        toolkit_evas_h = (screen_connector_toolkit_evas_h)data;
@@ -1015,6 +1016,8 @@ static void __toolkit_removed_cb(const char *appid, const char *instance_id, con
                return;
        }
 
+       toolkit_table = toolkit_evas_h->type_h->toolkit_table;
+
        if (toolkit_evas_h->img_tbm != NULL) {
                plug_id = evas_object_data_del(toolkit_evas_h->img_tbm, "___PLUGID");
                if (plug_id)
@@ -1026,7 +1029,7 @@ static void __toolkit_removed_cb(const char *appid, const char *instance_id, con
                toolkit_evas_h->ops->removed_cb(appid, instance_id, pid, toolkit_evas_h->img_file, toolkit_evas_h->data);
        }
 
-       g_hash_table_remove(toolkit_evas_h->type_h->toolkit_table, instance_id);
+       g_hash_table_remove(toolkit_table, instance_id);
 }
 
 EXPORT_API int screen_connector_toolkit_evas_set_delayed_resuming_time(int ms)