summaryrefslogtreecommitdiffstats
path: root/network/NetworkManager/patches/core-handle-D-Bus-disconnect-better-on-exit.patch
blob: fc21e53b01c3fd17f1b878654a3ed9b813318b87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 9751335f013248749d7d05c56c9c18af1410baa1 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Sun, 2 Jan 2011 10:49:36 -0600
Subject: [PATCH 8/8] core: handle D-Bus disconnect better on exit

We're just going to quit here anyway, so we don't need to
make sure the property filter is unregistered.  Fixes a
crash on exit if D-Bus has quit before NM has.
---
 src/nm-manager.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/nm-manager.c b/src/nm-manager.c
index afcc6ad..9bd5354 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -4364,10 +4364,11 @@ dispose (GObject *object)
 
 	/* Unregister property filter */
 	bus = nm_dbus_manager_get_connection (priv->dbus_mgr);
-	g_assert (bus);
-	dbus_connection = dbus_g_connection_get_connection (bus);
-	g_assert (dbus_connection);
-	dbus_connection_remove_filter (dbus_connection, prop_filter, manager);
+	if (bus) {
+		dbus_connection = dbus_g_connection_get_connection (bus);
+		g_assert (dbus_connection);
+		dbus_connection_remove_filter (dbus_connection, prop_filter, manager);
+	}
 	g_object_unref (priv->dbus_mgr);
 
 	if (priv->bluez_mgr)
-- 
1.7.3.4