From 576acdd2bf4cfde11f9b8ea15ec87bb7271c5502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 24 Nov 2011 17:00:33 +0100 Subject: [PATCH] libnm-glib: get access points in constructor to prevent D-Bus errors The errors appeared due to calling GetAccessPoints() on removed devices: nm_device_wifi_get_access_points: error getting access points: Method "GetAccessPoints" with signature "" on interface "org.freedesktop.NetworkManager.Device.Wireless" doesn't exist --- libnm-glib/nm-device-wifi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libnm-glib/nm-device-wifi.c b/libnm-glib/nm-device-wifi.c index 7d0e1b9f6d..7768985762 100644 --- a/libnm-glib/nm-device-wifi.c +++ b/libnm-glib/nm-device-wifi.c @@ -726,6 +726,13 @@ constructor (GType type, G_CALLBACK (state_changed_cb), NULL); + /* Get initial access points to prevent possible errors on + * AccessPointRemoved signal processing. We could make D-Bus + * GetAccessPoints() call on a removed WiFi device object (when + * AccessPointRemoved was triggered by removing the device). + */ + nm_device_wifi_get_access_points (NM_DEVICE_WIFI (object)); + return object; }