Fix crash when a network interface is removed

This resolves Bug 2278

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 10 years ago
parent 69b527cb2e
commit de063e3e84

@ -447,14 +447,15 @@ void Tray::slotRemoveDeviceTrayComponent(TQString dev)
// remove the appropriate action
TDENetworkDevice* dev_comp_dev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(dev_comp->device()));
TQString actionName = TQString("new_connection_%1").arg(dev_comp_dev->deviceNode());
TDEAction * deviceNewConnAction = actionCollection ()->action (actionName);
if (!deviceNewConnAction)
{
delete deviceNewConnAction;
deviceNewConnAction = NULL;
if (dev_comp_dev) {
TQString actionName = TQString("new_connection_%1").arg(dev_comp_dev->deviceNode());
TDEAction * deviceNewConnAction = actionCollection ()->action (actionName);
if (!deviceNewConnAction) {
delete deviceNewConnAction;
deviceNewConnAction = NULL;
}
}
// remove device_tray and delete it
d->trayComponents.remove(it);
delete dev_comp;

Loading…
Cancel
Save