summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Forsi <dforsi@src.gnome.org>2012-04-24 19:43:07 +0200
committerDaniele Forsi <dforsi@src.gnome.org>2012-04-25 11:57:41 +0200
commit4be835ee4cacc7942afdf3f51bbd319fc7f4ba5b (patch)
treece15755f6a654ae786284eac1bc5a92d15358e3e
parent991052679fb8d69e7d7912e7353c4e9af861731a (diff)
downloadgnome-bluetooth-4be835ee4cacc7942afdf3f51bbd319fc7f4ba5b.tar.gz
lib: fix memleaks in "test-deviceselection combo"
Strings returned by g_object_get() must be freed, objects must be unreferenced.
-rw-r--r--lib/test-deviceselection.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/test-deviceselection.c b/lib/test-deviceselection.c
index d428094f..c3a5beec 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))),