From 59b49489f00b672e78c0cf76870a68219d35dfac Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Fri, 7 Sep 2018 15:27:32 +0200 Subject: QML Preview: fix a possible crash Use the preview together with 3d runtime crashes at calling m_currentWindow->framePosition. Change-Id: I582f1bc5e17b24020a95f955752f0ada376289bf Reviewed-by: Ulf Hermann --- src/plugins/qmltooling/qmldbg_preview/qqmlpreviewhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewhandler.cpp b/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewhandler.cpp index 63397be499..21d415bbb6 100644 --- a/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewhandler.cpp +++ b/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewhandler.cpp @@ -100,7 +100,7 @@ bool QQmlPreviewHandler::eventFilter(QObject *obj, QEvent *event) m_lastPosition.initLastSavedWindowPosition(window); } } - if ((event->type() == QEvent::Move || event->type() == QEvent::Resize) && + if (m_currentWindow && (event->type() == QEvent::Move || event->type() == QEvent::Resize) && qobject_cast(obj) == m_currentWindow) { // we always start with factor 1 so calculate and save the origin as it would be not scaled m_lastPosition.setPosition(m_currentWindow->framePosition() * -- cgit v1.2.3