Remove the DhcpcdWi instance if the wpa_supplicant connection is lost.
[dhcpcd-ui] / src / dhcpcd-qt / dhcpcd-wi.cpp
index 5aa46638e60c0f50230dde3df7cceb510d675ea9..b8f2c547ed9439b0ae629441007ede124affbf5d 100644 (file)
@@ -58,8 +58,14 @@ DhcpcdWi::DhcpcdWi(DhcpcdQt *parent, DHCPCD_WPA *wpa)
 DhcpcdWi::~DhcpcdWi()
 {
 
+       if (menu) {
+               delete menu;
+               menu = NULL;
+       }
+
        dhcpcd_wi_scans_free(scans);
-       if (notifier != NULL)
+
+       if (notifier)
                delete notifier;
 }