Eo: Added a new magic type to mark already deleted objects.
authortasn <tasn>
Tue, 8 May 2012 14:22:57 +0000 (14:22 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 8 May 2012 14:22:57 +0000 (14:22 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/PROTO/eobj@70875 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

lib/eo.c

index 7af9e6e..24f2d47 100644 (file)
--- a/lib/eo.c
+++ b/lib/eo.c
@@ -33,7 +33,9 @@ typedef struct
 
 #define EO_EINA_MAGIC 0xa186bc32 /* Nothing magical about this number. */
 #define EO_EINA_MAGIC_STR "Eo"
-#define EO_CLASS_EINA_MAGIC 0xa186bb32 /* Nothing magical about this number. */
+#define EO_DELETED_EINA_MAGIC 0xa186bb32 /* Nothing magical about this number. */
+#define EO_DELETED_EINA_MAGIC_STR "Eo - Deleted object"
+#define EO_CLASS_EINA_MAGIC 0xa186ba32 /* Nothing magical about this number. */
 #define EO_CLASS_EINA_MAGIC_STR "Eo Class"
 
 #define EO_MAGIC_RETURN_VAL(d, magic, ret) \
@@ -1128,6 +1130,7 @@ _eo_unref(Eo *obj)
 
         _eo_callback_remove_all(obj);
 
+        EINA_MAGIC_SET(obj, EO_DELETED_EINA_MAGIC);
         free(obj);
      }
 }
@@ -1319,6 +1322,8 @@ eo_init(void)
      }
 
    eina_magic_string_static_set(EO_EINA_MAGIC, EO_EINA_MAGIC_STR);
+   eina_magic_string_static_set(EO_DELETED_EINA_MAGIC,
+         EO_DELETED_EINA_MAGIC_STR);
    eina_magic_string_static_set(EO_CLASS_EINA_MAGIC,
          EO_CLASS_EINA_MAGIC_STR);