evas/smart: print actual errors when smart api functions are called on non-smarts
authorMike Blumenkrantz <zmike@samsung.com>
Mon, 14 Oct 2019 13:29:43 +0000 (09:29 -0400)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 11 Nov 2019 02:18:25 +0000 (11:18 +0900)
Summary:
this is an error, and it should be printed
Depends on D10355

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10356

src/lib/evas/canvas/evas_object_smart.c

index e12f496..a0b2f35 100644 (file)
@@ -11,7 +11,7 @@
 
 #define EVAS_OBJECT_SMART_GET_OR_RETURN(eo_obj, ...) \
    Evas_Smart_Data *o = efl_data_scope_safe_get(eo_obj, MY_CLASS); \
-   do { if (!o) { MAGIC_CHECK_FAILED(eo_obj,0,MAGIC_SMART) return __VA_ARGS__; } } while (0)
+   do { if (!o) { ERR("calling smart object API on non-smart object!"); return __VA_ARGS__; } } while (0)
 
 extern Eina_Hash* signals_hash_table;
 
@@ -1619,7 +1619,7 @@ evas_object_smart_cleanup(Evas_Object *eo_obj)
           }
 
         evas_smart_cb_descriptions_resize(&o->callbacks_descriptions, 0);
-        evas_object_smart_data_set(eo_obj, NULL);
+        if (o->data) evas_object_smart_data_set(eo_obj, NULL);
      }
 
    obj->smart.parent = NULL;