aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@free.fr>2019-09-13 10:43:42 -0700
committerCedric Bail <cedric.bail@free.fr>2019-09-17 10:24:14 -0700
commite44811043957c40206ea0b2d170c221bdb8f30fd (patch)
tree76c370d1fbe8020ffe4b3639f2ce6e2b72bc004c
parentelementary: fix double eina_value_free in Efl.Ui.Homogeneous_Model.property.set (diff)
downloadefl-e44811043957c40206ea0b2d170c221bdb8f30fd.tar.gz
elementary: properly shutdown and cleanup Efl.Ui.Position_Manager.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9946
-rw-r--r--src/lib/elementary/efl_ui_position_manager_grid.c18
-rw-r--r--src/lib/elementary/efl_ui_position_manager_grid.eo1
-rw-r--r--src/lib/elementary/efl_ui_position_manager_list.c15
-rw-r--r--src/lib/elementary/efl_ui_position_manager_list.eo2
4 files changed, 33 insertions, 3 deletions
diff --git a/src/lib/elementary/efl_ui_position_manager_grid.c b/src/lib/elementary/efl_ui_position_manager_grid.c
index dc863d0d5f..fee0855ec6 100644
--- a/src/lib/elementary/efl_ui_position_manager_grid.c
+++ b/src/lib/elementary/efl_ui_position_manager_grid.c
@@ -766,7 +766,16 @@ _efl_ui_position_manager_grid_efl_ui_position_manager_entity_version(Eo *obj EIN
EOLIAN static void
_efl_ui_position_manager_grid_efl_ui_position_manager_data_access_v1_data_access_set(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd, void *obj_access_data, Efl_Ui_Position_Manager_Object_Batch_Callback obj_access, Eina_Free_Cb obj_access_free_cb, void *size_access_data, Efl_Ui_Position_Manager_Size_Batch_Callback size_access, Eina_Free_Cb size_access_free_cb, int size)
{
+ // Cleanup cache first
_group_cache_invalidate(obj, pd);
+
+ // Clean callback if they were set
+ if (pd->callbacks.object.free_cb)
+ pd->callbacks.object.free_cb(pd->callbacks.object.data);
+ if (pd->callbacks.size.free_cb)
+ pd->callbacks.size.free_cb(pd->callbacks.size.data);
+
+ // Set them
pd->callbacks.object.data = obj_access_data;
pd->callbacks.object.access = obj_access;
pd->callbacks.object.free_cb = obj_access_free_cb;
@@ -779,6 +788,15 @@ _efl_ui_position_manager_grid_efl_ui_position_manager_data_access_v1_data_access
}
+EOLIAN static void
+_efl_ui_position_manager_grid_efl_object_invalidate(Eo *obj,
+ Efl_Ui_Position_Manager_Grid_Data *pd EINA_UNUSED)
+{
+ efl_ui_position_manager_data_access_v1_data_access_set(obj, NULL, NULL, NULL, NULL, NULL, NULL, 0);
+
+ efl_invalidate(efl_super(obj, EFL_UI_POSITION_MANAGER_GRID_CLASS));
+}
+
EOLIAN static Efl_Object*
_efl_ui_position_manager_grid_efl_object_finalize(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd)
{
diff --git a/src/lib/elementary/efl_ui_position_manager_grid.eo b/src/lib/elementary/efl_ui_position_manager_grid.eo
index 0af0270545..91deee348e 100644
--- a/src/lib/elementary/efl_ui_position_manager_grid.eo
+++ b/src/lib/elementary/efl_ui_position_manager_grid.eo
@@ -18,5 +18,6 @@ class @beta Efl.Ui.Position_Manager.Grid extends Efl.Object
Efl.Ui.Layout_Orientable.orientation {set; get;}
Efl.Ui.Position_Manager.Data_Access_V1.data_access {set;}
Efl.Object.finalize;
+ Efl.Object.invalidate;
}
}
diff --git a/src/lib/elementary/efl_ui_position_manager_list.c b/src/lib/elementary/efl_ui_position_manager_list.c
index 5a159f308c..706fce768b 100644
--- a/src/lib/elementary/efl_ui_position_manager_list.c
+++ b/src/lib/elementary/efl_ui_position_manager_list.c
@@ -480,12 +480,14 @@ _efl_ui_position_manager_list_efl_ui_layout_orientable_orientation_get(const Eo
}
EOLIAN static void
-_efl_ui_position_manager_list_efl_object_destructor(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd)
+_efl_ui_position_manager_list_efl_object_invalidate(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd)
{
if (pd->rebuild_absolut_size)
eina_future_cancel(pd->rebuild_absolut_size);
- efl_destructor(efl_super(obj, MY_CLASS));
+ efl_ui_position_manager_data_access_v1_data_access_set(obj, NULL, NULL, NULL, NULL, NULL, NULL, 0);
+
+ efl_invalidate(efl_super(obj, MY_CLASS));
}
EOLIAN static int
@@ -524,7 +526,16 @@ _efl_ui_position_manager_list_efl_ui_position_manager_entity_version(Eo *obj EIN
EOLIAN static void
_efl_ui_position_manager_list_efl_ui_position_manager_data_access_v1_data_access_set(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd, void *obj_access_data, Efl_Ui_Position_Manager_Object_Batch_Callback obj_access, Eina_Free_Cb obj_access_free_cb, void *size_access_data, Efl_Ui_Position_Manager_Size_Batch_Callback size_access, Eina_Free_Cb size_access_free_cb, int size)
{
+ // Cleanup cache first
cache_invalidate(obj, pd);
+
+ // Clean callback if they were set
+ if (pd->callbacks.object.free_cb)
+ pd->callbacks.object.free_cb(pd->callbacks.object.data);
+ if (pd->callbacks.size.free_cb)
+ pd->callbacks.size.free_cb(pd->callbacks.size.data);
+
+ // Set them
pd->callbacks.object.data = obj_access_data;
pd->callbacks.object.access = obj_access;
pd->callbacks.object.free_cb = obj_access_free_cb;
diff --git a/src/lib/elementary/efl_ui_position_manager_list.eo b/src/lib/elementary/efl_ui_position_manager_list.eo
index 0f66b0a282..3d80b201d4 100644
--- a/src/lib/elementary/efl_ui_position_manager_list.eo
+++ b/src/lib/elementary/efl_ui_position_manager_list.eo
@@ -8,7 +8,7 @@ class @beta Efl.Ui.Position_Manager.List extends Efl.Object
the layout of all items. This supports the vertical and horizontal orientation.
]]
implements {
- Efl.Object.destructor;
+ Efl.Object.invalidate;
Efl.Ui.Position_Manager.Entity.version;
Efl.Ui.Position_Manager.Entity.viewport {set;}
Efl.Ui.Position_Manager.Entity.scroll_position {set;}