Skip to content

Commit ec70186

Browse files
RJVBec1oud
authored andcommitted
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 <[email protected]>
1 parent 4bc86c3 commit ec70186

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gui/kernel/qwidget_mac.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4619,7 +4619,7 @@ const QRect frameRect(QPoint(x - fStrut.left(), y - fStrut.top()),
46194619

46204620
setWSGeometry(false, oldRect);
46214621

4622-
if (isResize && QApplicationPrivate::graphicsSystem())
4622+
if (isResize && q->parentWidget() && QApplicationPrivate::graphicsSystem())
46234623
invalidateBuffer_resizeHelper(oldp, olds);
46244624
}
46254625

0 commit comments

Comments
 (0)