[anjuta] debug-manager: Fix two leaks of GFile objects.



commit 5aad26a680ba10e70024788ca32a13eb4f9d9b30
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Tue Jan 1 23:48:06 2013 +0100

    debug-manager: Fix two leaks of GFile objects.
    
    1. BreakPointItem keeps a reference to the GFile so the file needs to be unreffed when
        the BreakPointItem is freed.
    
    2. ianjuta_file_get_file() returns a GFile which needs to be unreffed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690957

 plugins/debug-manager/breakpoints.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/plugins/debug-manager/breakpoints.c b/plugins/debug-manager/breakpoints.c
index e4d2473..f655f88 100644
--- a/plugins/debug-manager/breakpoints.c
+++ b/plugins/debug-manager/breakpoints.c
@@ -220,6 +220,8 @@ breakpoint_item_unref (BreakpointItem *bi)
 		bi->editor = NULL;
 	}
 
+	g_clear_object(&bi->file);
+
 	g_free ((char *)bi->bp.file);
 	bi->bp.file = NULL;
 	g_free ((char *)bi->bp.function);
@@ -1048,6 +1050,8 @@ breakpoints_dbase_add_breakpoint (BreakpointsDBase *bd,  BreakpointItem *bi)
 			g_object_add_weak_pointer (G_OBJECT (ed), (gpointer)&bi->editor);
 			breakpoints_dbase_connect_to_editor (bd, ed);
 		}
+		if (file)
+			g_object_unref (file);
 	}
 
 	if (bd->debugger != NULL)



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