diff options
author | René J.V. Bertin <rjvbertin@gmail.com> | 2014-10-06 17:08:00 (GMT) |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-04-21 13:00:04 (GMT) |
commit | ec701869f5c7f70608e71331223b22454c3a3e4c (patch) | |
tree | ac1caa7b2c4110abb56a632e82f2c28bc9055e17 | |
parent | 4bc86c34e2d2f4c1d1c1002c94f857d9adc51194 (diff) | |
download | Qt-ec701869f5c7f70608e71331223b22454c3a3e4c.zip Qt-ec701869f5c7f70608e71331223b22454c3a3e4c.tar.gz Qt-ec701869f5c7f70608e71331223b22454c3a3e4c.tar.bz2 |
OSX: avoid crash in invalidateBuffer_resizeHelper on parentless widget
KDE4 has a KMenu::addTitle function that adds a distinctive item to
a menu, as the predecessor to Qt5's QMenu::addSection. On OS X this
function leads to a null pointer access because
invalidateBuffer_resizeHelper is called on a parentless widget.
This patch filters out such widgets.
Task-number: QTBUG-41716
Change-Id: I8f62a14d201ce44e038ceff87ee5db98277f1b87
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 6e1672b..5730020 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4619,7 +4619,7 @@ void QWidgetPrivate::setGeometry_sys_helper(int x, int y, int w, int h, bool isM setWSGeometry(false, oldRect); - if (isResize && QApplicationPrivate::graphicsSystem()) + if (isResize && q->parentWidget() && QApplicationPrivate::graphicsSystem()) invalidateBuffer_resizeHelper(oldp, olds); } |