Close down everything if dhcpcd connection lost.
authorRoy Marples <roy@marples.name>
Tue, 16 Sep 2014 20:07:28 +0000 (20:07 +0000)
committerRoy Marples <roy@marples.name>
Tue, 16 Sep 2014 20:07:28 +0000 (20:07 +0000)
src/dhcpcd-qt/dhcpcd-qt.cpp

index e7a3d808f83218be811f8c9600d10d91592655a0..4be2b4df27ca8b428e85130897ed6b267ef3d3da 100644 (file)
@@ -190,11 +190,25 @@ void DhcpcdQt::statusCallback(const char *status)
                aniCounter = 0;
                onLine = carrier = false;
                setIcon("status", "network-offline");
+               trayIcon->setToolTip(tr("Not connected to dhcpcd"));
+               /* Close down everything */
                if (notifier) {
                        delete notifier;
                        notifier = NULL;
                }
-               trayIcon->setToolTip(tr("Not connected to dhcpcd"));
+               if (ssidMenu) {
+                       delete ssidMenu;
+                       ssidMenu = NULL;
+               }
+               if (about) {
+                       delete about;
+                       about = NULL;
+               }
+               if (preferences) {
+                       delete preferences;
+                       preferences = NULL;
+               }
+               preferencesAction->setEnabled(false);
        } else {
                bool refresh;