From f1599fe699912fae2e663a21a6f2cd6e9dedb4df Mon Sep 17 00:00:00 2001 From: Tambet Ingo Date: Wed, 26 Sep 2007 08:46:29 +0000 Subject: [PATCH] 2007-09-26 Tambet Ingo * src/nm-device-802-3-ethernet.c (real_get_best_connection): * Don't leak NMManager. The problem with leaking NMManager is that on shutdown, it doesn't get destroyed, which means none of the devices get brought down properly, which in turn leaves DHCP client running. * src/nm-device-802-11-wireless.c (real_get_best_connection): * Ditto. (supplicant_connection_timeout_cb): Ditto. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2887 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 10 ++++++++++ src/nm-device-802-11-wireless.c | 4 ++++ src/nm-device-802-3-ethernet.c | 6 +++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 30ea4f00c2..1e810fc4e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-09-26 Tambet Ingo + + * src/nm-device-802-3-ethernet.c (real_get_best_connection): Don't leak NMManager. + The problem with leaking NMManager is that on shutdown, it doesn't get destroyed, + which means none of the devices get brought down properly, which in turn leaves + DHCP client running. + + * src/nm-device-802-11-wireless.c (real_get_best_connection): Ditto. + (supplicant_connection_timeout_cb): Ditto. + 2007-09-25 Dan Williams * src/nm-device.c diff --git a/src/nm-device-802-11-wireless.c b/src/nm-device-802-11-wireless.c index bdef396824..9caa1a05a6 100644 --- a/src/nm-device-802-11-wireless.c +++ b/src/nm-device-802-11-wireless.c @@ -716,6 +716,8 @@ real_get_best_connection (NMDevice *dev, g_slist_free (connections); } + g_object_unref (manager); + if (find_info.found) *specific_object = (char *) nm_ap_get_dbus_path (find_info.found_ap); return find_info.found; @@ -2566,6 +2568,8 @@ real_act_stage2_config (NMDevice *dev) connection, setting_name, FALSE); + g_object_unref (manager); + return NM_ACT_STAGE_RETURN_POSTPONE; } else { NMSettingWireless *s_wireless = (NMSettingWireless *) nm_connection_get_setting (connection, NM_SETTING_WIRELESS); diff --git a/src/nm-device-802-3-ethernet.c b/src/nm-device-802-3-ethernet.c index 2b27702962..fba434cf4a 100644 --- a/src/nm-device-802-3-ethernet.c +++ b/src/nm-device-802-3-ethernet.c @@ -369,7 +369,7 @@ real_get_best_connection (NMDevice *dev, char **specific_object) { NMDevice8023Ethernet * self = NM_DEVICE_802_3_ETHERNET (dev); - NMManager *manager = nm_manager_get (); + NMManager *manager; GSList *connections = NULL; BestConnectionInfo find_info; guint32 caps; @@ -385,6 +385,8 @@ real_get_best_connection (NMDevice *dev, if (!(caps & NM_DEVICE_CAP_CARRIER_DETECT)) return NULL; + manager = nm_manager_get (); + /* System connections first */ connections = nm_manager_get_connections (manager, NM_CONNECTION_TYPE_SYSTEM); memset (&find_info, 0, sizeof (BestConnectionInfo)); @@ -400,6 +402,8 @@ real_get_best_connection (NMDevice *dev, g_slist_free (connections); } + g_object_unref (manager); + /* Wired devices autoconnect with DHCP by default if they have a link */ link_active = nm_device_has_active_link (dev); if (!find_info.found && link_active) {