forked from enlightenment/efl
make ending programs safe while iterating
SVN revision: 7314
This commit is contained in:
parent
604a586caf
commit
97700a07e9
|
@ -166,6 +166,7 @@ _edje_timer_cb(void *data)
|
|||
animl = evas_list_remove(animl, animl->data);
|
||||
if (!ed->paused)
|
||||
{
|
||||
ed->walking_actions = 1;
|
||||
for (l = ed->actions; l; l = l->next)
|
||||
newl = evas_list_append(newl, l->data);
|
||||
while (newl)
|
||||
|
@ -174,8 +175,29 @@ _edje_timer_cb(void *data)
|
|||
|
||||
runp = newl->data;
|
||||
newl = evas_list_remove(newl, newl->data);
|
||||
_edje_program_run_iterate(runp, t);
|
||||
if (!runp->delete_me)
|
||||
_edje_program_run_iterate(runp, t);
|
||||
}
|
||||
for (l = ed->actions; l; l = l->next)
|
||||
newl = evas_list_append(newl, l->data);
|
||||
while (newl)
|
||||
{
|
||||
Edje_Running_Program *runp;
|
||||
|
||||
runp = newl->data;
|
||||
newl = evas_list_remove(newl, newl->data);
|
||||
if (runp->delete_me)
|
||||
{
|
||||
_edje_anim_count--;
|
||||
runp->edje->actions =
|
||||
evas_list_remove(runp->edje->actions, runp);
|
||||
if (!runp->edje->actions)
|
||||
_edje_animators =
|
||||
evas_list_remove(_edje_animators, runp->edje);
|
||||
free(runp);
|
||||
}
|
||||
}
|
||||
ed->walking_actions = 0;
|
||||
}
|
||||
_edje_thaw(ed);
|
||||
_edje_unref(ed);
|
||||
|
|
|
@ -372,6 +372,7 @@ struct _Edje
|
|||
unsigned short paused : 1;
|
||||
unsigned short no_anim : 1;
|
||||
unsigned short calc_only : 1;
|
||||
unsigned short walking_actions : 1;
|
||||
double paused_at;
|
||||
Evas *evas; /* the evas this edje belongs to */
|
||||
Evas_Object *obj; /* the smart object */
|
||||
|
@ -444,6 +445,7 @@ struct _Edje_Running_Program
|
|||
Edje *edje;
|
||||
Edje_Program *program;
|
||||
double start_time;
|
||||
char delete_me : 1;
|
||||
};
|
||||
|
||||
struct _Edje_Signal_Callback
|
||||
|
|
|
@ -233,10 +233,14 @@ _edje_program_run_iterate(Edje_Running_Program *runp, double tim)
|
|||
}
|
||||
}
|
||||
_edje_recalc(runp->edje);
|
||||
_edje_anim_count--;
|
||||
runp->edje->actions = evas_list_remove(runp->edje->actions, runp);
|
||||
if (!runp->edje->actions)
|
||||
_edje_animators = evas_list_remove(_edje_animators, runp->edje);
|
||||
runp->delete_me = 1;
|
||||
if (!runp->edje->walking_actions)
|
||||
{
|
||||
_edje_anim_count--;
|
||||
runp->edje->actions = evas_list_remove(runp->edje->actions, runp);
|
||||
if (!runp->edje->actions)
|
||||
_edje_animators = evas_list_remove(_edje_animators, runp->edje);
|
||||
}
|
||||
_edje_emit(runp->edje, "program,stop", runp->program->name);
|
||||
if (runp->program->after >= 0)
|
||||
{
|
||||
|
@ -248,7 +252,7 @@ _edje_program_run_iterate(Edje_Running_Program *runp, double tim)
|
|||
}
|
||||
_edje_thaw(runp->edje);
|
||||
_edje_unref(runp->edje);
|
||||
free(runp);
|
||||
if (!runp->edje->walking_actions) free(runp);
|
||||
return 0;
|
||||
}
|
||||
_edje_recalc(runp->edje);
|
||||
|
@ -284,14 +288,18 @@ _edje_program_end(Edje *ed, Edje_Running_Program *runp)
|
|||
}
|
||||
}
|
||||
_edje_recalc(runp->edje);
|
||||
_edje_anim_count--;
|
||||
runp->edje->actions = evas_list_remove(runp->edje->actions, runp);
|
||||
if (!runp->edje->actions)
|
||||
_edje_animators = evas_list_remove(_edje_animators, runp->edje);
|
||||
runp->delete_me = 1;
|
||||
if (!runp->edje->walking_actions)
|
||||
{
|
||||
_edje_anim_count--;
|
||||
runp->edje->actions = evas_list_remove(runp->edje->actions, runp);
|
||||
if (!runp->edje->actions)
|
||||
_edje_animators = evas_list_remove(_edje_animators, runp->edje);
|
||||
}
|
||||
_edje_emit(runp->edje, "program,stop", runp->program->name);
|
||||
_edje_thaw(runp->edje);
|
||||
_edje_unref(runp->edje);
|
||||
free(runp);
|
||||
if (!runp->edje->walking_actions) free(runp);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue