[gnome-bluetooth] lib: fix memleaks in "test-deviceselection combo"
- From: Daniele Forsi <dforsi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] lib: fix memleaks in "test-deviceselection combo"
- Date: Wed, 25 Apr 2012 13:20:03 +0000 (UTC)
commit 4be835ee4cacc7942afdf3f51bbd319fc7f4ba5b
Author: Daniele Forsi <dforsi src gnome org>
Date: Tue Apr 24 19:43:07 2012 +0200
lib: fix memleaks in "test-deviceselection combo"
Strings returned by g_object_get() must be freed, objects must be unreferenced.
lib/test-deviceselection.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/lib/test-deviceselection.c b/lib/test-deviceselection.c
index d428094..c3a5bee 100644
--- a/lib/test-deviceselection.c
+++ b/lib/test-deviceselection.c
@@ -302,9 +302,11 @@ static void device_changed_cb (GObject *object,
tree = bluetooth_chooser_get_treeview (BLUETOOTH_CHOOSER (chooser));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree));
gtk_tree_selection_get_selected (selection, &model, &iter);
- if (model == NULL)
- return;
- bluetooth_client_dump_device (model, &iter);
+ if (model != NULL)
+ bluetooth_client_dump_device (model, &iter);
+
+ g_object_unref (chooser);
+ g_free (device);
}
static GtkWidget *
@@ -330,6 +332,7 @@ create_combo_dialogue (const char *bdaddr)
NULL);
g_object_set (G_OBJECT (selector), "device", bdaddr, NULL);
bluetooth_chooser_start_discovery (BLUETOOTH_CHOOSER (chooser));
+ g_object_unref (chooser);
gtk_container_set_border_width(GTK_CONTAINER(selector), 5);
gtk_widget_show(selector);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]