diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2012-12-12 14:58:14 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-08 11:47:50 +0100 |
commit | d37547add0369d45182271754c0a35032d7de2d3 (patch) | |
tree | 13d6d211c67e61ff24dfe49b5b46d40692a30a0a | |
parent | da33815fbe356d068af413ca1af9237f551e4f03 (diff) |
Don't try to grab Windows with invalid or a zero size
It will end up in LiveLock trying it. Because the Window will never
appear in the Rendering thread and setting the grabContent.
On the other end, grabWindow will never return because it waits for the
RenderingThread to set grabContent
Change-Id: Ia1c365acf033732b3e2e9d9d7dc8e73f9e8f4870
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
-rw-r--r-- | src/quick/items/qquickthreadedwindowmanager.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick/items/qquickthreadedwindowmanager.cpp b/src/quick/items/qquickthreadedwindowmanager.cpp index 4c38686298..63e2c46d79 100644 --- a/src/quick/items/qquickthreadedwindowmanager.cpp +++ b/src/quick/items/qquickthreadedwindowmanager.cpp @@ -845,6 +845,9 @@ QImage QQuickRenderThreadSingleContextWindowManager::grab(QQuickWindow *window) if (QThread::currentThread() != qApp->thread()) { qWarning("QQuickWindow::grabFrameBuffer: can only be called from the GUI thread"); return QImage(); + } else if (window->size().width() <= 0 || window->size().height() <= 0 ) { + qWarning("QQuickWindow::grabFrameBuffer: Can't grab a Window with size %dx%d", window->size().width(), window->size().height()); + return QImage(); } #ifdef THREAD_DEBUG |