[gtk+] inspector: Don't leak recordings



commit 18dc994de731c8c5d58e7c9ad72379018944f38d
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 17 19:12:27 2018 -0500

    inspector: Don't leak recordings
    
    g_list_model_get_item is transfer full, so we need
    to drop the references we get from it. This was showing
    up while testing the GL texture cache in GtkGLArea.

 gtk/inspector/recorder.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index 921b21d..32dcfb0 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -120,6 +120,9 @@ recordings_list_row_selected (GtkListBox           *box,
     }
 
   gtk_tree_view_expand_all (GTK_TREE_VIEW (priv->render_node_tree));
+
+  if (recording)
+    g_object_unref (recording);
 }
 
 static void
@@ -773,6 +776,8 @@ gtk_inspector_recorder_recordings_list_create_widget (gpointer item,
         {
           GtkInspectorRecording *r = g_list_model_get_item (priv->recordings, i);
 
+          g_object_unref (r);
+
           if (r == recording)
             break;
 


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