Skip to content

Commit

Permalink
Merge branch 'jb44681' into 'mer-5.6'
Browse files Browse the repository at this point in the history
[qtdeclarative] Fix crash due to an interaction between an item layer and anchors. Fixes JB#44681

See merge request mer-core/qtdeclarative!28
  • Loading branch information
adenexter committed Nov 13, 2019
2 parents 549ae5a + dcf3fbd commit 7bd6917
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/quick/items/qquickitem.cpp
Expand Up @@ -7676,7 +7676,13 @@ void QQuickItemLayer::classBegin()

void QQuickItemLayer::componentComplete()
{
Q_ASSERT(!m_componentComplete);
// There is a window in QQuickItem::completeCreate() between where componentComplete in the
// item is set to true and componentComplete() is called on a layer in which arbitrary code
// may execute due to anchor evaluations and create a layer on which classBegin() was not called.
// If that happens componentComplete() should be ignored or activate() will be called twice.
if (m_componentComplete)
return;

m_componentComplete = true;
if (m_enabled)
activate();
Expand Down

0 comments on commit 7bd6917

Please sign in to comment.