Commit 47519cb7 authored by Lamarque Souza's avatar Lamarque Souza
Browse files

Another try to solve the dangling pointers problem.

CCBUG: 210878
parent 62509a42
......@@ -29,20 +29,11 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
ActivatableList::ActivatableList(QObject * parent)
: QObject(parent), d_ptr(new ActivatableListPrivate)
{
init();
}
ActivatableList::ActivatableList(ActivatableListPrivate & dd, QObject * parent)
: QObject(parent), d_ptr(&dd)
{
init();
}
void ActivatableList::init()
{
QObject::connect(Solid::Control::NetworkManager::notifier(),
SIGNAL(statusChanged(Solid::Networking::Status)),
this, SLOT(nm_restart_workaround(Solid::Networking::Status)));
}
ActivatableList::~ActivatableList()
......@@ -50,18 +41,6 @@ ActivatableList::~ActivatableList()
delete d_ptr;
}
void ActivatableList::nm_restart_workaround(Solid::Networking::Status status)
{
/* NetworkManager has stopped, remove all activatables to prevent crash when it starts again */
if (status == Solid::Networking::Unknown) {
Q_D(ActivatableList);
kDebug() << "----- Emptying activatables list, activatables cleared: " << d->activatables.count();
foreach (Knm::Activatable * activatable, d->activatables) {
removeActivatable(activatable);
}
}
}
void ActivatableList::registerObserver(ActivatableObserver * observer, ActivatableObserver * insertAfter)
{
Q_D(ActivatableList);
......
......@@ -60,9 +60,7 @@ public:
virtual void unregisterObserver(ActivatableObserver *);
protected Q_SLOTS:
void activatableChanged();
void nm_restart_workaround(Solid::Networking::Status status);
protected:
void init();
void addActivatableInternal(Knm::Activatable * activatable);
void notifyOnAddActivatable(Knm::Activatable * activatable);
ActivatableListPrivate * d_ptr;
......
......@@ -66,6 +66,7 @@ Solid::Control::WirelessNetworkInterfaceEnvironment::WirelessNetworkInterfaceEnv
Solid::Control::WirelessNetworkInterfaceEnvironment::~WirelessNetworkInterfaceEnvironment()
{
kDebug();
wirelessEnabledChanged(false);
delete d_ptr;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment