From 5cda0172e0eb912ef4814f3c5618686cbb1a5da1 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 16 Mar 2017 10:04:01 +0100 Subject: Fix crash in QWindowPrivate::applyCursor when screen is null QWindow::setVisible calls QWindowPrivate::applyCursor without checking if screen() returns null. This patch adds a check in QWindowPrivate::applyCursor that the screen is not null. Now that it is tested there, no need to test it from the other caller (setCursor) This patch should not change behavior of setCursor at all, it should only fix the crash when coming from setVisible Task-number: QTBUG-59528 Change-Id: I06bbdb4e04c02ac840ba637242d1f2cfde5bdd62 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qwindow_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/kernel/qwindow_p.h') diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index b8a9f5d3de..c1955be6b6 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -118,7 +118,7 @@ public: void maybeQuitOnLastWindowClosed(); #ifndef QT_NO_CURSOR void setCursor(const QCursor *c = 0); - void applyCursor(); + bool applyCursor(); #endif void deliverUpdateRequest(); -- cgit v1.2.3