forked from enlightenment/efl
evas_data: Fix safety checks in evas_object_data
This relies on efl_isa rather than the broken magic check (by broken I mean it only checks for NULL).
This commit is contained in:
parent
f06c8b08f3
commit
9e235faf90
|
@ -1,35 +1,27 @@
|
|||
#include "evas_common_private.h"
|
||||
#include "evas_private.h"
|
||||
|
||||
|
||||
EAPI void
|
||||
evas_object_data_set(Evas_Object *obj, const char *key, const void *data)
|
||||
evas_object_data_set(Evas_Object *eo_obj, const char *key, const void *data)
|
||||
{
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return;
|
||||
MAGIC_CHECK_END();
|
||||
efl_key_data_set(obj, key, data);
|
||||
if (!efl_isa(eo_obj, EFL_CANVAS_OBJECT_CLASS)) return;
|
||||
efl_key_data_set(eo_obj, key, data);
|
||||
}
|
||||
|
||||
EAPI void *
|
||||
evas_object_data_get(const Evas_Object *obj, const char *key)
|
||||
evas_object_data_get(const Evas_Object *eo_obj, const char *key)
|
||||
{
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return NULL;
|
||||
MAGIC_CHECK_END();
|
||||
void *data = NULL;
|
||||
data = efl_key_data_get((Evas_Object *)obj, key);
|
||||
return data;
|
||||
if (!efl_isa(eo_obj, EFL_CANVAS_OBJECT_CLASS)) return NULL;
|
||||
return efl_key_data_get(eo_obj, key);
|
||||
}
|
||||
|
||||
EAPI void *
|
||||
evas_object_data_del(Evas_Object *obj, const char *key)
|
||||
evas_object_data_del(Evas_Object *eo_obj, const char *key)
|
||||
{
|
||||
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
||||
return NULL;
|
||||
MAGIC_CHECK_END();
|
||||
void *data = NULL;
|
||||
data = efl_key_data_get(obj, key);
|
||||
efl_key_data_set(obj, key, NULL);
|
||||
void *data;
|
||||
|
||||
if (!efl_isa(eo_obj, EFL_CANVAS_OBJECT_CLASS)) return NULL;
|
||||
data = efl_key_data_get(eo_obj, key);
|
||||
efl_key_data_set(eo_obj, key, NULL);
|
||||
return data;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue