[gimp] libgimp: do not leak dialog containers' size groups.



commit 2d84ad719f0de4b2b19c8a848ce92f988145b0e7
Author: Jehan <jehan girinstud io>
Date:   Sun Aug 1 17:56:46 2021 +0200

    libgimp: do not leak dialog containers' size groups.
    
    As explained in GtkSizeGroup docs, all objects inside a size group holds
    a reference to it. So once we destroy the last object inside these, it
    will be freed too and we should drop the initial reference after adding
    the objects.
    
    Only the main size group reference is kept until the end, because we are
    adding and removing objects from it regularly, so it is possible that it
    is empty again at some intermediary states. Yet we don't want to free it
    when this happens.

 libgimp/gimpproceduredialog.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/libgimp/gimpproceduredialog.c b/libgimp/gimpproceduredialog.c
index d9d27f19d8..1468d9d2b4 100644
--- a/libgimp/gimpproceduredialog.c
+++ b/libgimp/gimpproceduredialog.c
@@ -1838,6 +1838,7 @@ gimp_procedure_dialog_fill_container_list (GimpProcedureDialog *dialog,
           gtk_widget_show (widget);
         }
     }
+  g_clear_object (&sz_group);
 
   if (free_properties)
     g_list_free (properties);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]