Client: Disconnect registry listener on destruction
If a display outlives a QWaylandClientExtension and a new global is announced we end up delivering an event to a now deleted extension which will crash. Change-Id: Idc0de40be61a2f7627ab4963e1fe29b22fbf3f04 Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
This commit is contained in:
parent
0ff3bf30d6
commit
dbcc603faf
@ -91,6 +91,13 @@ QWaylandClientExtension::QWaylandClientExtension(const int ver)
|
||||
QMetaObject::invokeMethod(this, "initialize", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
QWaylandClientExtension::~QWaylandClientExtension()
|
||||
{
|
||||
Q_D(QWaylandClientExtension);
|
||||
if (d->registered && !QCoreApplication::closingDown())
|
||||
d->waylandIntegration->display()->removeListener(&QWaylandClientExtensionPrivate::handleRegistryGlobal, this);
|
||||
}
|
||||
|
||||
QtWaylandClient::QWaylandIntegration *QWaylandClientExtension::integration() const
|
||||
{
|
||||
Q_D(const QWaylandClientExtension);
|
||||
|
@ -63,6 +63,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandClientExtension : public QObject
|
||||
Q_PROPERTY(bool active READ isActive NOTIFY activeChanged)
|
||||
public:
|
||||
QWaylandClientExtension(const int version);
|
||||
~QWaylandClientExtension();
|
||||
|
||||
QtWaylandClient::QWaylandIntegration *integration() const;
|
||||
int version() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user