diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-03-28 08:12:05 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-29 21:22:38 +0100 |
commit | 51d4eb8f5ba769cd50457b2f479acc3f30b9f78f (patch) | |
tree | 9047ebed8b67736b94f206e6023084420da819eb /src/gui/image/qnativeimage.cpp | |
parent | c5805acccda4b3762bfd4d23ee6622053bb7104d (diff) |
If no screens, attempting to create a window results in clean exit
Asserting is only relevant for debug builds, and there were a couple
of other places that a segfault would typically occur before the assert
had a chance.
Change-Id: I1abc82eb3ecfa91050117fab1525f4cbd82ff486
Task-number: QTBUG-37876
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/gui/image/qnativeimage.cpp')
-rw-r--r-- | src/gui/image/qnativeimage.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp index 09cdf41399..356bdc09e4 100644 --- a/src/gui/image/qnativeimage.cpp +++ b/src/gui/image/qnativeimage.cpp @@ -64,6 +64,8 @@ QNativeImage::~QNativeImage() QImage::Format QNativeImage::systemFormat() { + if (!QGuiApplication::primaryScreen()) + return QImage::Format_Invalid; return QGuiApplication::primaryScreen()->handle()->format(); } |