Fix ssid selection and a crash on exit.
authorRoy Marples <roy@marples.name>
Fri, 12 Sep 2014 14:29:58 +0000 (14:29 +0000)
committerRoy Marples <roy@marples.name>
Fri, 12 Sep 2014 14:29:58 +0000 (14:29 +0000)
src/dhcpcd-qt/dhcpcd-qt.cpp
src/dhcpcd-qt/dhcpcd-ssidmenu.cpp
src/dhcpcd-qt/dhcpcd-wi.cpp

index 2561e25160edc3a3b1aa91668a3413535ef51794..ee988f297417e8fbe5f6397f5b03d653eb6ce5eb 100644 (file)
@@ -76,15 +76,16 @@ DhcpcdQt::DhcpcdQt()
 DhcpcdQt::~DhcpcdQt()
 {
 
-       qDeleteAll(*wis);
-       delete wis;
-
        if (con != NULL) {
                dhcpcd_close(con);
                dhcpcd_free(con);
        }
 
        free(lastStatus);
+
+       qDeleteAll(*wis);
+       delete wis;
+
 }
 
 void DhcpcdQt::animate()
index fbb0d1775424d1a958dd6994f508513d1fbcd443..ed8f510a199e1ff9fc7af046aea7b3f76e442001 100644 (file)
@@ -56,9 +56,7 @@ DhcpcdSsidMenu::DhcpcdSsidMenu(QWidget *parent, QWidgetAction *wa,
        layout->setAlignment(bar, Qt::AlignRight);
        setScan(scan);
 
-       button->installEventFilter(this);
-       licon->installEventFilter(this);
-       bar->installEventFilter(this);
+       this->installEventFilter(this);
 }
 
 QWidgetAction *DhcpcdSsidMenu::getWidgetAction()
index 0252c4d7d49033537416e3e25fc6c9b1e4f056a5..b6326e280350dd1c42ad5f1cd0da447968769cc0 100644 (file)
@@ -63,10 +63,12 @@ DhcpcdWi::~DhcpcdWi()
                menu = NULL;
        }
 
-       dhcpcd_wi_scans_free(scans);
-
-       if (notifier)
+       if (notifier) {
                delete notifier;
+               notifier = NULL;
+       }
+
+       dhcpcd_wi_scans_free(scans);
 }
 
 DHCPCD_WPA *DhcpcdWi::getWpa()