summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>2012-10-24 16:27:24 -0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-26 12:24:56 +0200
commitc89dc4fdd2770ba3ad52303a2f4cb0c6403a2ecd (patch)
treeccba4728b7e38523531973404559ae5da6d54701 /src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
parente8170aee1fd2e423d92616fbdf1c173d9e4b7913 (diff)
QNX: Query dynamic buffer count at runtime
While unlikely, there are cases in which QQnxWindow::renderBuffer() is called before the window buffers have been created. Without this check, the program will abort on QQnxBuffer constructor, since the value that will be passed to it will be of an invalid buffer. Change-Id: I9ad5926dca856570032dcf10b6975e8f3364c284 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp')
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index b8ec91d488..11babe3aaa 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -71,7 +71,10 @@ QQnxRasterBackingStore::~QQnxRasterBackingStore()
QPaintDevice *QQnxRasterBackingStore::paintDevice()
{
- return m_platformWindow->renderBuffer().image();
+ if (m_platformWindow->hasBuffers())
+ return m_platformWindow->renderBuffer().image();
+
+ return 0;
}
void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)