Don't crash on a null window pointer.

Task-number: QTBUG-30731

Change-Id: Id256b915012b43d1eb85bba62cbc1d42cfb58b34
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
Morten Johan Sørvig 2013-04-23 14:29:56 +02:00 committed by The Qt Project
parent f2fa65e4bf
commit 56cc59110a

View File

@ -231,6 +231,9 @@ void QCocoaNativeInterface::setWindowContentView(QPlatformWindow *window, void *
void QCocoaNativeInterface::registerTouchWindow(QWindow *window, bool enable) void QCocoaNativeInterface::registerTouchWindow(QWindow *window, bool enable)
{ {
if (!window)
return;
// Make sure the QCocoaWindow is created when enabling. Disabling might // Make sure the QCocoaWindow is created when enabling. Disabling might
// happen on window destruction, don't (re)create the QCocoaWindow then. // happen on window destruction, don't (re)create the QCocoaWindow then.
if (enable) if (enable)