win/widget: free array when object is deleted.
authorHosang Kim <hosang12.kim@samsung.com>
Tue, 17 Mar 2020 04:12:19 +0000 (04:12 +0000)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 17 Mar 2020 21:36:30 +0000 (06:36 +0900)
It makes a memory leak.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11522

src/lib/elementary/efl_ui_widget.c
src/lib/elementary/efl_ui_win.c

index 4dee0af..3c114f6 100644 (file)
@@ -5794,6 +5794,11 @@ _efl_ui_widget_efl_object_destructor(Eo *obj, Elm_Widget_Smart_Data *sd)
         efl_weak_unref(&sd->logical.parent);
         sd->logical.parent = NULL;
      }
+   if (sd->children)
+     {
+        eina_array_free(sd->children);
+        sd->children = NULL;
+     }
 
    // TIZEN_ONLY(20150709) : atspi relations api
    if (sd->atspi_custom_relations)
index 94d61d6..c383721 100644 (file)
@@ -3733,6 +3733,9 @@ _efl_ui_win_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Win_Data *sd)
    eina_array_free(sd->profile.available);
    sd->profile.available = NULL;
 
+   eina_array_free(sd->planned_changes);
+   sd->planned_changes = NULL;
+
    free(sd->wm_rot.rots);
    sd->wm_rot.rots = NULL;