workaround for a dangling pointer usage in
QQuickWindowPrivate::polishItems added
This commit is contained in:
parent
56e4544c47
commit
07b6ad0e7a
@ -1697,8 +1697,24 @@ void QskControl::itemChange( QQuickItem::ItemChange change,
|
|||||||
qskFilterWindow( value.window );
|
qskFilterWindow( value.window );
|
||||||
}
|
}
|
||||||
|
|
||||||
QskWindowChangeEvent event(
|
#if 1
|
||||||
qskReleasedWindowCounter->window(), value.window );
|
auto oldWindow = qskReleasedWindowCounter->window();
|
||||||
|
if ( oldWindow && ( oldWindow->activeFocusItem() == this ) )
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
When deleting the activeFocusItem inside of QQuickItem::polish
|
||||||
|
we run into crashes because of QQuickWindow::activeFocusItem()
|
||||||
|
becomes a dangling pointer being used at the end of
|
||||||
|
QQuickWindowPrivate::polishItems.
|
||||||
|
The crash becomes less likely since
|
||||||
|
*/
|
||||||
|
|
||||||
|
QQuickWindowPrivate::get( oldWindow )->clearFocusInScope(
|
||||||
|
qskNearestFocusScope( this ), this, Qt::OtherFocusReason );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QskWindowChangeEvent event( oldWindow, value.window );
|
||||||
QCoreApplication::sendEvent( this, &event );
|
QCoreApplication::sendEvent( this, &event );
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user