path: root/src
diff options
authorGustavo Sverzut Barbieri <>2013-11-28 20:42:16 -0200
committerGustavo Sverzut Barbieri <>2013-11-28 20:42:16 -0200
commitd91a6973187e56b3df767ee2e7043ce585b8eb08 (patch)
treee6d99a27113cf2bacb5aa87619c0c8e7f2a26200 /src
parent8670180dbb9e1e3d666a04e139096530fc15e4f3 (diff)
genlist: clear 'rel' pointer when it becomes unused during del_pre_hook.
If we're walking an item and it's deleted, the memory won't go away immediately in _item_del_pre_hook() as would in _item_del(), then it's not enough to remove ourselves from the reverse-relative list of the item we were relative to, we also need to clean our own relative pointer so we won't touch it later when the item is not being walked anymore and _item_del() is called. I was getting this annoying error with espionage application, opening an interface of an object and then closing the window or selecting another bus name (whatever would call elm_genlist_clear()). During the clear process genlist will flag the next item as "walking" so it's not gone when the current item dies (would happen if next item is a subitem). The item would run _item_del_pre_hook() but not _item_del(), but on the next loop iteration the next item would be the current, then not walking anymore and during _item_del() it would access it->item->rel which would point to the now-dead item.
Diffstat (limited to 'src')
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index e4697706d..e362e4908 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -5260,8 +5260,11 @@ _item_del_pre_hook(Elm_Object_Item *item)
5260 { 5260 {
5261 // FIXME: relative will be better to be fixed. it is too harsh. 5261 // FIXME: relative will be better to be fixed. it is too harsh.
5262 if (it->item->rel) 5262 if (it->item->rel)
5263 it->item->rel->item->rel_revs = 5263 {
5264 eina_list_remove(it->item->rel->item->rel_revs, it); 5264 it->item->rel->item->rel_revs =
5265 eina_list_remove(it->item->rel->item->rel_revs, it);
5266 it->item->rel = NULL;
5267 }
5265 if (it->item->rel_revs) 5268 if (it->item->rel_revs)
5266 { 5269 {
5267 Elm_Gen_Item *tmp; 5270 Elm_Gen_Item *tmp;