[network-manager-applet] bluetooth: fix crash detecting DUN the second time



commit 19abd2cf4eef09caf5c9d83de9c3158684b4e052
Author: Dan Williams <dcbw redhat com>
Date:   Thu Apr 21 13:16:12 2011 -0500

    bluetooth: fix crash detecting DUN the second time
    
    Some stuff wasn't getting cleaned up, and other stuff was
    getting cleaned up at the wrong time.

 src/gnome-bluetooth/bt-widget.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/gnome-bluetooth/bt-widget.c b/src/gnome-bluetooth/bt-widget.c
index 4c09c1c..23c51c8 100644
--- a/src/gnome-bluetooth/bt-widget.c
+++ b/src/gnome-bluetooth/bt-widget.c
@@ -314,6 +314,11 @@ dun_cleanup (PluginInfo *info, const char *message, gboolean uncheck)
 	g_slist_free (info->modem_proxies);
 	info->modem_proxies = NULL;
 
+	if (info->mm_proxy) {
+		g_object_unref (info->mm_proxy);
+		info->mm_proxy = NULL;
+	}
+
 	if (info->dun_proxy) {
 		if (info->rfcomm_iface) {
 			dbus_g_proxy_call_no_reply (info->dun_proxy, "Disconnect",
@@ -331,11 +336,6 @@ dun_cleanup (PluginInfo *info, const char *message, gboolean uncheck)
 	g_free (info->rfcomm_iface);
 	info->rfcomm_iface = NULL;
 
-	if (info->bus) {
-		dbus_g_connection_unref (info->bus);
-		info->bus = NULL;
-	}
-
 	if (info->dun_timeout_id) {
 		g_source_remove (info->dun_timeout_id);
 		info->dun_timeout_id = 0;
@@ -943,6 +943,8 @@ plugin_info_destroy (gpointer data)
 	g_object_unref (info->settings);
 	g_object_unref (info->btmodel);
 	g_object_unref (info->btclient);
+	if (info->bus)
+		dbus_g_connection_unref (info->bus);
 	memset (info, 0, sizeof (PluginInfo));
 	g_free (info);
 }



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