ContainmentInterface: Move to lambda to a private slot
The containment interface deletion order isn't clear. It can happen that it is deleted before the application quits, and then this lambda is called, and its accesses internals of the class even though it has been deleted. Reviewd-By: Marco Martin
This commit is contained in:
parent
c77377221b
commit
2dbeea4d23
@ -73,13 +73,16 @@ ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent, cons
|
||||
}
|
||||
|
||||
connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit,
|
||||
[=]() {
|
||||
if (!m_containment) {
|
||||
return;
|
||||
}
|
||||
disconnect(m_containment.data(), &Plasma::Containment::appletRemoved,
|
||||
this, &ContainmentInterface::appletRemovedForward);
|
||||
});
|
||||
this, &ContainmentInterface::slotAboutToQuit);
|
||||
}
|
||||
|
||||
void ContainmentInterface::slotAboutToQuit()
|
||||
{
|
||||
if (!m_containment) {
|
||||
return;
|
||||
}
|
||||
disconnect(m_containment.data(), &Plasma::Containment::appletRemoved,
|
||||
this, &ContainmentInterface::appletRemovedForward);
|
||||
}
|
||||
|
||||
void ContainmentInterface::init()
|
||||
|
@ -205,6 +205,7 @@ protected Q_SLOTS:
|
||||
|
||||
private Q_SLOTS:
|
||||
Plasma::Applet *createApplet(const QString &plugin, const QVariantList &args, const QPoint &pos);
|
||||
void slotAboutToQuit();
|
||||
|
||||
private:
|
||||
void clearDataForMimeJob(KIO::Job *job);
|
||||
|
Loading…
x
Reference in New Issue
Block a user