summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-07-05 19:12:23 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-07-05 19:15:13 +0900
commit85a9bd54303dc0a221b0825b396cd5d62386ca15 (patch)
tree531f441a10aedb3435c4fba0c78fffec12f162e0
parentf8ca9b5cc8aaafdee199cd3a3a0ab97f3dfa13ba (diff)
eo: Fix crash during eo_shutdown
I was getting a crash in eo_shutdown, inside _efl_event_pointer_class_destructor as I was calling eo_del from there. But the parent class was already destroyed. Assuming class IDs can only go up, and child classes are only instanciated after all their parents, it is safer to call the class destructors in reverse order. Obviously, still pretty sure eo_del() in a class_destructor is not a good idea...
-rw-r--r--src/lib/eo/eo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index eec43ff43a..f147f0d2c7 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1727,7 +1727,7 @@ EAPI Eina_Bool
1727eo_shutdown(void) 1727eo_shutdown(void)
1728{ 1728{
1729 size_t i; 1729 size_t i;
1730 _Eo_Class **cls_itr = _eo_classes; 1730 _Eo_Class **cls_itr = _eo_classes + _eo_classes_last_id - 1;
1731 1731
1732 if (--_eo_init_count > 0) 1732 if (--_eo_init_count > 0)
1733 return EINA_TRUE; 1733 return EINA_TRUE;
@@ -1738,7 +1738,7 @@ eo_shutdown(void)
1738 1738
1739 _eo_add_fallback_shutdown(); 1739 _eo_add_fallback_shutdown();
1740 1740
1741 for (i = 0 ; i < _eo_classes_last_id ; i++, cls_itr++) 1741 for (i = 0 ; i < _eo_classes_last_id ; i++, cls_itr--)
1742 { 1742 {
1743 if (*cls_itr) 1743 if (*cls_itr)
1744 eo_class_free(*cls_itr); 1744 eo_class_free(*cls_itr);