summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@digia.com>2012-10-01 10:10:08 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-08 09:01:41 +0200
commit9577c227810731da40704598d6b4babc139eaec6 (patch)
tree0ff26b1e646bb6a3e0eba3c5f47d14e848accb85 /src/gui/kernel
parenta0c3a57aed5cde37017733e7cf5e41cc6a1174aa (diff)
Prevent crashing on screen deletion.
Even child windows need to hook into the screen destroyed signal to avoid having a dangling screen pointer. Change-Id: I7b613356c333be6e9dfdf5db45f70a521a9b8fe2 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qwindow.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 1e2ac5b0a6..79927cbc71 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -177,6 +177,7 @@ QWindow::QWindow(QWindow *parent)
d->screen = parent->screen();
if (!d->screen)
d->screen = QGuiApplication::primaryScreen();
+ connect(d->screen, SIGNAL(destroyed(QObject*)), this, SLOT(screenDestroyed(QObject*)));
QGuiApplicationPrivate::window_list.prepend(this);
}
@@ -202,6 +203,7 @@ QWindow::QWindow(QWindowPrivate &dd, QWindow *parent)
d->screen = parent->screen();
if (!d->screen)
d->screen = QGuiApplication::primaryScreen();
+ connect(d->screen, SIGNAL(destroyed(QObject*)), this, SLOT(screenDestroyed(QObject*)));
QGuiApplicationPrivate::window_list.prepend(this);
}