network-manager-applet r807 - in trunk: . src
- From: dcbw svn gnome org
- To: svn-commits-list gnome org
- Subject: network-manager-applet r807 - in trunk: . src
- Date: Tue, 29 Jul 2008 04:57:29 +0000 (UTC)
Author: dcbw
Date: Tue Jul 29 04:57:29 2008
New Revision: 807
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=807&view=rev
Log:
2008-07-28 Dan Williams <dcbw redhat com>
* src/applet-device-wifi.c
- (wireless_device_added): disconnect from the Settings object's
new-connection signal when the device is destroyed to prevent
callbacks for invalid, removed devices
Modified:
trunk/ChangeLog
trunk/src/applet-device-wifi.c
Modified: trunk/src/applet-device-wifi.c
==============================================================================
--- trunk/src/applet-device-wifi.c (original)
+++ trunk/src/applet-device-wifi.c Tue Jul 29 04:57:29 2008
@@ -907,7 +907,8 @@
NMApplet *applet;
NMDeviceWifi *device;
guint id;
- gulong last_notification_time;
+ gulong last_notification_time;
+ guint new_con_id;
};
/* Scan the list of access points, looking for the case where we have no
@@ -1029,12 +1030,23 @@
}
static void
+free_ap_notification_data (gpointer user_data)
+{
+ struct ap_notification_data *data = user_data;
+
+ g_signal_handler_disconnect (applet_get_settings (data->applet), data->new_con_id);
+ memset (data, 0, sizeof (*data));
+ g_free (data);
+}
+
+static void
wireless_device_added (NMDevice *device, NMApplet *applet)
{
NMDeviceWifi *wdev = NM_DEVICE_WIFI (device);
const GPtrArray *aps;
int i;
struct ap_notification_data *data;
+ guint id;
g_signal_connect (wdev,
"notify::" NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT,
@@ -1052,13 +1064,17 @@
data = g_new0 (struct ap_notification_data, 1);
data->applet = applet;
data->device = wdev;
- g_object_set_data_full (G_OBJECT (wdev), "notify-wireless-avail-data", data, g_free);
/* We also need to hook up to the settings to find out when we have new connections
- * that might be candididates.
+ * that might be candididates. Keep the ID around so we can disconnect
+ * when the device is destroyed.
*/
- g_signal_connect (applet_get_settings (applet), "new-connection",
- G_CALLBACK (on_new_connection),
- data);
+ id = g_signal_connect (applet_get_settings (applet), "new-connection",
+ G_CALLBACK (on_new_connection),
+ data);
+ data->new_con_id = id;
+ g_object_set_data_full (G_OBJECT (wdev), "notify-wireless-avail-data",
+ data, free_ap_notification_data);
+
queue_avail_access_point_notification (device);
/* Hash all APs this device knows about */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]