From ec701869f5c7f70608e71331223b22454c3a3e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20J=2EV=2E=20Bertin?= Date: Mon, 6 Oct 2014 19:08:00 +0200 Subject: OSX: avoid crash in invalidateBuffer_resizeHelper on parentless widget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gui/kernel/qwidget_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- cgit v0.12