fix segv when adding optimizations to edje message handling

613e1715be (and friends) added a bit a
biug where messages in the queue were not skipped as they were before
causing a segv witha null lookup. this fixes that. eclipse about
dialog showed this bug up. no longer happens now.
This commit is contained in:
Carsten Haitzler 2019-06-21 09:29:52 +01:00
parent 48215560ab
commit 1c02b7740d
1 changed files with 16 additions and 12 deletions

View File

@ -180,7 +180,7 @@ static void
_edje_object_message_signal_process_do(Eo *obj EINA_UNUSED, Edje *ed) _edje_object_message_signal_process_do(Eo *obj EINA_UNUSED, Edje *ed)
{ {
Eina_Inlist *l, *ln; Eina_Inlist *l, *ln;
Edje *lookup_ed; Edje *lookup_ed = NULL;
Eina_List *groups = NULL, *lg; Eina_List *groups = NULL, *lg;
Edje_Message *em; Edje_Message *em;
int gotos = 0; int gotos = 0;
@ -188,7 +188,8 @@ _edje_object_message_signal_process_do(Eo *obj EINA_UNUSED, Edje *ed)
if (!ed) return; if (!ed) return;
groups = ed->groups; groups = ed->groups;
if (groups)
{
for (l = msgq; l; l = ln) for (l = msgq; l; l = ln)
{ {
ln = l->next; ln = l->next;
@ -204,6 +205,7 @@ _edje_object_message_signal_process_do(Eo *obj EINA_UNUSED, Edje *ed)
} }
} }
} }
}
tmp_msgq_processing++; tmp_msgq_processing++;
again: again:
@ -213,12 +215,14 @@ again:
em = INLIST_CONTAINER(Edje_Message, l, inlist_edje); em = INLIST_CONTAINER(Edje_Message, l, inlist_edje);
if (!em->in_tmp_msgq) continue; if (!em->in_tmp_msgq) continue;
// so why this? any group edje is not the parent - skip this // so why this? any group edje is not the parent - skip this
lookup_ed = NULL;
EINA_LIST_FOREACH(groups, lg, lookup_ed) EINA_LIST_FOREACH(groups, lg, lookup_ed)
{ {
if (em->edje == lookup_ed) break; if (em->edje == lookup_ed) break;
} }
if (!lookup_ed) continue;
tmp_msgq = eina_inlist_remove(tmp_msgq, &(em->inlist_main)); tmp_msgq = eina_inlist_remove(tmp_msgq, &(em->inlist_main));
em->edje->messages = eina_inlist_remove(em->edje->messages, &(em->inlist_edje)); lookup_ed->messages = eina_inlist_remove(lookup_ed->messages, &(em->inlist_edje));
if (!lookup_ed->delete_me) if (!lookup_ed->delete_me)
{ {
lookup_ed->processing_messages++; lookup_ed->processing_messages++;