summaryrefslogtreecommitdiff
path: root/lib/bluetooth-settings-widget.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-12-07 16:02:06 +0100
committerBastien Nocera <hadess@hadess.net>2013-12-07 16:02:06 +0100
commitafddd6da500a8b4fdd6dabdb2d7d8f496277d95f (patch)
treebe50ec03acb85a6358c1f40604768a6441495833 /lib/bluetooth-settings-widget.c
parent4c6d1c486af2d567980bb233f8161122a261f20b (diff)
downloadgnome-bluetooth-afddd6da500a8b4fdd6dabdb2d7d8f496277d95f.tar.gz
settings: Fix memory leak when connection fails
The error would be leaked. Also make sure to print the error for debugging purposes.
Diffstat (limited to 'lib/bluetooth-settings-widget.c')
-rw-r--r--lib/bluetooth-settings-widget.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c
index 4f6e822d..67b5e81a 100644
--- a/lib/bluetooth-settings-widget.c
+++ b/lib/bluetooth-settings-widget.c
@@ -179,11 +179,14 @@ connect_done (GObject *source_object,
button = GTK_SWITCH (WID ("switch_connection"));
/* Reset the switch if it failed */
- if (success == FALSE)
+ if (success == FALSE) {
+ g_debug ("Connection failed to %s: %s", data->bdaddr, error->message);
gtk_switch_set_active (button, !gtk_switch_get_active (button));
+ }
set_connecting_page (self, CONNECTING_NOTEBOOK_PAGE_SWITCH);
}
+ g_clear_error (&error);
remove_connecting (self, data->bdaddr);
//FIXME show an error if it failed?