[wayland] Reset internalWindow if the QWindow gets destroyed

Prevents use after free usages.

Reviewed-By: Bhushan Shah
This commit is contained in:
Martin Gräßlin 2015-11-18 15:43:54 +01:00
parent 4d883a9cda
commit 681113e4a6

View file

@ -609,6 +609,7 @@ void ShellClient::findInternalWindow()
m_internalWindow = w;
connect(m_internalWindow, &QWindow::xChanged, this, &ShellClient::updateInternalWindowGeometry);
connect(m_internalWindow, &QWindow::yChanged, this, &ShellClient::updateInternalWindowGeometry);
connect(m_internalWindow, &QWindow::destroyed, this, [this] { m_internalWindow = nullptr; });
// Try reading the window type from the QWindow. PlasmaCore.Dialog provides a dynamic type property
// let's check whether it exists, if it does it's our window type