diff options
author | Slávek Banko <[email protected]> | 2014-12-30 13:34:03 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2014-12-30 13:34:34 +0100 |
commit | b06c73b10a0ec2b973e300be6b9a8ed2de62c50a (patch) | |
tree | 1f799014b9a4c1f9da0982a60e11fe4061e651f9 | |
parent | 69b527cb2e8dfc814c5baf051728d3d676f087f8 (diff) | |
download | tdenetworkmanager-b06c73b10a0ec2b973e300be6b9a8ed2de62c50a.tar.gz tdenetworkmanager-b06c73b10a0ec2b973e300be6b9a8ed2de62c50a.zip |
Fix crash when a network interface is removed
This resolves Bug 2278
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit de063e3e84da8a8077eba18720ef4754a99f9afd)
-rw-r--r-- | tdenetworkmanager/src/tdenetman-tray.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tdenetworkmanager/src/tdenetman-tray.cpp b/tdenetworkmanager/src/tdenetman-tray.cpp index 6b19a12..533fa7e 100644 --- a/tdenetworkmanager/src/tdenetman-tray.cpp +++ b/tdenetworkmanager/src/tdenetman-tray.cpp @@ -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; |