evas: Add some crash prevention checks

This could happen if objects still have references while evas is being
shut down (a bad situation).
This commit is contained in:
Jean-Philippe Andre 2017-11-06 16:36:23 +09:00
parent f90b88422c
commit 066f2c5cb7
1 changed files with 12 additions and 0 deletions

View File

@ -1607,6 +1607,7 @@ EAPI void
evas_object_size_hint_display_mode_set(Eo *eo_obj, Evas_Display_Mode dispmode) evas_object_size_hint_display_mode_set(Eo *eo_obj, Evas_Display_Mode dispmode)
{ {
Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj); Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(eo_obj);
EVAS_OBJECT_DATA_ALIVE_CHECK(obj); EVAS_OBJECT_DATA_ALIVE_CHECK(obj);
evas_object_async_block(obj); evas_object_async_block(obj);
if (EINA_UNLIKELY(!obj->size_hints)) if (EINA_UNLIKELY(!obj->size_hints))
@ -1634,6 +1635,8 @@ _efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_set(Eo *eo_obj, Evas_Ob
{ {
if (obj->delete_me) if (obj->delete_me)
return; return;
EVAS_OBJECT_DATA_VALID_CHECK(obj);
evas_object_async_block(obj); evas_object_async_block(obj);
if (EINA_UNLIKELY(!obj->size_hints)) if (EINA_UNLIKELY(!obj->size_hints))
{ {
@ -1674,6 +1677,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_max_set(Eo *eo_obj, Evas_Object_Protec
if (obj->delete_me) if (obj->delete_me)
return; return;
EVAS_OBJECT_DATA_VALID_CHECK(obj);
evas_object_async_block(obj); evas_object_async_block(obj);
if (EINA_UNLIKELY(!obj->size_hints)) if (EINA_UNLIKELY(!obj->size_hints))
{ {
@ -1737,6 +1741,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_min_set(Eo *eo_obj, Evas_Object_Protec
if (obj->delete_me) if (obj->delete_me)
return; return;
EVAS_OBJECT_DATA_VALID_CHECK(obj);
evas_object_async_block(obj); evas_object_async_block(obj);
if (EINA_UNLIKELY(!obj->size_hints)) if (EINA_UNLIKELY(!obj->size_hints))
{ {
@ -1772,6 +1777,7 @@ _efl_canvas_object_efl_gfx_size_hint_hint_aspect_set(Eo *eo_obj, Evas_Object_Pro
if (obj->delete_me) if (obj->delete_me)
return; return;
EVAS_OBJECT_DATA_VALID_CHECK(obj);
evas_object_async_block(obj); evas_object_async_block(obj);
if (EINA_UNLIKELY(!obj->size_hints)) if (EINA_UNLIKELY(!obj->size_hints))
{ {
@ -1805,6 +1811,8 @@ _efl_canvas_object_efl_gfx_size_hint_hint_align_set(Eo *eo_obj, Evas_Object_Prot
{ {
if (obj->delete_me) if (obj->delete_me)
return; return;
EVAS_OBJECT_DATA_VALID_CHECK(obj);
evas_object_async_block(obj); evas_object_async_block(obj);
if (!obj->legacy.align_set) obj->legacy.align_set = 1; if (!obj->legacy.align_set) obj->legacy.align_set = 1;
if (EINA_UNLIKELY(!obj->size_hints)) if (EINA_UNLIKELY(!obj->size_hints))
@ -1839,6 +1847,8 @@ _efl_canvas_object_efl_gfx_size_hint_hint_weight_set(Eo *eo_obj, Evas_Object_Pro
{ {
if (obj->delete_me) if (obj->delete_me)
return; return;
EVAS_OBJECT_DATA_VALID_CHECK(obj);
evas_object_async_block(obj); evas_object_async_block(obj);
if (!obj->legacy.weight_set) obj->legacy.weight_set = 1; if (!obj->legacy.weight_set) obj->legacy.weight_set = 1;
if (EINA_UNLIKELY(!obj->size_hints)) if (EINA_UNLIKELY(!obj->size_hints))
@ -1877,6 +1887,8 @@ _efl_canvas_object_efl_gfx_size_hint_hint_margin_set(Eo *eo_obj, Evas_Object_Pro
{ {
if (obj->delete_me) if (obj->delete_me)
return; return;
EVAS_OBJECT_DATA_VALID_CHECK(obj);
evas_object_async_block(obj); evas_object_async_block(obj);
if (EINA_UNLIKELY(!obj->size_hints)) if (EINA_UNLIKELY(!obj->size_hints))
{ {