fix edje_shutdown being calle3d before all edje object are deleted -

keep edje internal data around until all refs to edje are gone from
objects, then shtudown the core.



SVN revision: 61984
This commit is contained in:
Carsten Haitzler 2011-08-02 07:23:05 +00:00
parent 29864666c9
commit 8af403fcff
3 changed files with 37 additions and 8 deletions

View File

@ -107,16 +107,12 @@ edje_init(void)
return --_edje_init_count;
}
static int _edje_users = 0;
EAPI int
edje_shutdown(void)
static void
_edje_shutdown_core(void)
{
if (--_edje_init_count != 0)
return _edje_init_count;
if (_edje_timer)
ecore_animator_del(_edje_timer);
_edje_timer = NULL;
if (_edje_users > 0) return;
_edje_file_cache_shutdown();
_edje_color_class_members_free();
@ -141,6 +137,33 @@ edje_shutdown(void)
eina_log_domain_unregister(_edje_default_log_dom);
_edje_default_log_dom = -1;
eina_shutdown();
}
void
_edje_lib_ref(void)
{
_edje_users++;
}
void
_edje_lib_unref(void)
{
_edje_users--;
if (_edje_users != 0) return;
if (_edje_init_count == 0) _edje_shutdown_core();
}
EAPI int
edje_shutdown(void)
{
if (--_edje_init_count != 0)
return _edje_init_count;
if (_edje_timer)
ecore_animator_del(_edje_timer);
_edje_timer = NULL;
_edje_shutdown_core();
return _edje_init_count;
}

View File

@ -1883,4 +1883,7 @@ const char *edje_string_id_get(const Edje_String *es);
void _edje_object_orientation_inform(Evas_Object *obj);
void _edje_lib_ref(void);
void _edje_lib_unref(void);
#endif

View File

@ -23,6 +23,8 @@ edje_object_add(Evas *evas)
{
Evas_Object *e;
_edje_lib_ref();
if (!_edje_smart)
{
memset(&_edje_smart_parent, 0, sizeof(_edje_smart_parent));
@ -150,6 +152,7 @@ _edje_smart_del(Evas_Object * obj)
_edje_file_del(ed);
_edje_clean_objects(ed);
_edje_unref(ed);
_edje_lib_unref();
}
static void