From 265626a86be7ef83be91d518bd5b3c3759853535 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Fri, 19 Aug 2016 16:22:04 +0900 Subject: [PATCH] fix a invalid memoray access. The focused_item could be invalid if the enventor item is removed before seting it null. Also, the previous warning is no more invalid because it was introduced by unsafe threads workers that was already fixed before. --- src/bin/file_mgr.c | 6 ++++++ src/bin/file_tab.c | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/bin/file_mgr.c b/src/bin/file_mgr.c index b1047d6..11220c7 100644 --- a/src/bin/file_mgr.c +++ b/src/bin/file_mgr.c @@ -262,6 +262,12 @@ void file_mgr_file_del(Enventor_Item *it) { if (!it) return; + + file_mgr_data *fmd = g_fmd; + + if (fmd->focused_it == it) + fmd->focused_it = NULL; + file_tab_it_remove(it); enventor_item_del(it); } diff --git a/src/bin/file_tab.c b/src/bin/file_tab.c index 46fbb56..09ba052 100644 --- a/src/bin/file_tab.c +++ b/src/bin/file_tab.c @@ -90,10 +90,6 @@ file_tab_it_del(file_tab_it *fti) { Evas_Object *list = elm_object_item_widget_get(fti->it); - //Be aware, if you change this api call order, it may break enventor. - //Just keep this here as possible. - enventor_item_del(fti->enventor_it); - //FIXME: If this item is main, then it needs to close project. //If the focused item is removed, then enable next item. @@ -114,6 +110,7 @@ file_tab_it_del(file_tab_it *fti) } //Remove item. + enventor_item_del(fti->enventor_it); elm_object_item_del(fti->it); ecore_animator_del(fti->animator); free(fti);