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.
This commit is contained in:
Hermet Park 2016-08-19 16:22:04 +09:00
parent c5a606e090
commit 265626a86b
2 changed files with 7 additions and 4 deletions

View File

@ -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);
}

View File

@ -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);