summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-06-21 09:29:52 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-06-21 09:29:52 +0100
commit1c02b7740de0938bcbad2e26ee055ad570cdf77c (patch)
treef05f3ba45ea721cbe3653cce11f1149e43dbdc9c
parent48215560abc3a2c3eded6c2d0912240a7d29f22a (diff)
fix segv when adding optimizations to edje message handling
613e1715be1114c2221f1a12f067e3d1e215265f (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.
-rw-r--r--src/lib/edje/edje_message_queue.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/lib/edje/edje_message_queue.c b/src/lib/edje/edje_message_queue.c
index 2e7e7ad9ba..ea3adc824a 100644
--- a/src/lib/edje/edje_message_queue.c
+++ b/src/lib/edje/edje_message_queue.c
@@ -180,7 +180,7 @@ static void
180_edje_object_message_signal_process_do(Eo *obj EINA_UNUSED, Edje *ed) 180_edje_object_message_signal_process_do(Eo *obj EINA_UNUSED, Edje *ed)
181{ 181{
182 Eina_Inlist *l, *ln; 182 Eina_Inlist *l, *ln;
183 Edje *lookup_ed; 183 Edje *lookup_ed = NULL;
184 Eina_List *groups = NULL, *lg; 184 Eina_List *groups = NULL, *lg;
185 Edje_Message *em; 185 Edje_Message *em;
186 int gotos = 0; 186 int gotos = 0;
@@ -188,19 +188,21 @@ _edje_object_message_signal_process_do(Eo *obj EINA_UNUSED, Edje *ed)
188 if (!ed) return; 188 if (!ed) return;
189 189
190 groups = ed->groups; 190 groups = ed->groups;
191 191 if (groups)
192 for (l = msgq; l; l = ln)
193 { 192 {
194 ln = l->next; 193 for (l = msgq; l; l = ln)
195 em = INLIST_CONTAINER(Edje_Message, l, inlist_main);
196 EINA_LIST_FOREACH(groups, lg, lookup_ed)
197 { 194 {
198 if (em->edje == lookup_ed) 195 ln = l->next;
196 em = INLIST_CONTAINER(Edje_Message, l, inlist_main);
197 EINA_LIST_FOREACH(groups, lg, lookup_ed)
199 { 198 {
200 msgq = eina_inlist_remove(msgq, &(em->inlist_main)); 199 if (em->edje == lookup_ed)
201 tmp_msgq = eina_inlist_append(tmp_msgq, &(em->inlist_main)); 200 {
202 em->in_tmp_msgq = EINA_TRUE; 201 msgq = eina_inlist_remove(msgq, &(em->inlist_main));
203 break; 202 tmp_msgq = eina_inlist_append(tmp_msgq, &(em->inlist_main));
203 em->in_tmp_msgq = EINA_TRUE;
204 break;
205 }
204 } 206 }
205 } 207 }
206 } 208 }
@@ -213,12 +215,14 @@ again:
213 em = INLIST_CONTAINER(Edje_Message, l, inlist_edje); 215 em = INLIST_CONTAINER(Edje_Message, l, inlist_edje);
214 if (!em->in_tmp_msgq) continue; 216 if (!em->in_tmp_msgq) continue;
215 // so why this? any group edje is not the parent - skip this 217 // so why this? any group edje is not the parent - skip this
218 lookup_ed = NULL;
216 EINA_LIST_FOREACH(groups, lg, lookup_ed) 219 EINA_LIST_FOREACH(groups, lg, lookup_ed)
217 { 220 {
218 if (em->edje == lookup_ed) break; 221 if (em->edje == lookup_ed) break;
219 } 222 }
223 if (!lookup_ed) continue;
220 tmp_msgq = eina_inlist_remove(tmp_msgq, &(em->inlist_main)); 224 tmp_msgq = eina_inlist_remove(tmp_msgq, &(em->inlist_main));
221 em->edje->messages = eina_inlist_remove(em->edje->messages, &(em->inlist_edje)); 225 lookup_ed->messages = eina_inlist_remove(lookup_ed->messages, &(em->inlist_edje));
222 if (!lookup_ed->delete_me) 226 if (!lookup_ed->delete_me)
223 { 227 {
224 lookup_ed->processing_messages++; 228 lookup_ed->processing_messages++;