2007-09-26 Tambet Ingo <tambet@gmail.com>

* 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
This commit is contained in:
Tambet Ingo 2007-09-26 08:46:29 +00:00
parent 9c2848d56a
commit f1599fe699
3 changed files with 19 additions and 1 deletions

View file

@ -1,3 +1,13 @@
2007-09-26 Tambet Ingo <tambet@gmail.com>
* 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 <dcbw@redhat.com>
* src/nm-device.c

View file

@ -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);

View file

@ -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) {