Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb41922' into 'mer-5.6'
[qtdeclarative] Fix crash in ModelNodeMetaObject::emitDirectNotifies. Fixes JB#41922

See merge request mer-core/qtdeclarative!20
  • Loading branch information
Slava Monich committed May 25, 2018
2 parents cd6cecd + e26ef5d commit b63ee00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/qml/types/qqmllistmodel.cpp
Expand Up @@ -1334,8 +1334,8 @@ void ModelNodeMetaObject::emitDirectNotifies(const int *changedRoles, int roleCo
QQmlData *ddata = QQmlData::get(object(), /*create*/false);
if (!ddata)
return;
QQmlEnginePrivate *ep = QQmlEnginePrivate::get(qmlEngine(m_model));
if (!ep)
// There's nothing to emit if we're a list model in a worker thread.
if (!qmlEngine(m_model))
return;
for (int i = 0; i < roleCount; ++i) {
const int changedRole = changedRoles[i];
Expand Down
Expand Up @@ -209,6 +209,7 @@ void tst_qqmllistmodelworkerscript::dynamic_data()
QTest::newRow("get4") << "{append({'foo':123});get(0).foo}" << 123 << "" << dr;
QTest::newRow("get-modify1") << "{append({'foo':123,'bar':456});get(0).foo = 333;get(0).foo}" << 333 << "" << dr;
QTest::newRow("get-modify2") << "{append({'z':1});append({'foo':123,'bar':456});get(1).bar = 999;get(1).bar}" << 999 << "" << dr;
QTest::newRow("get-set") << "{append({'foo':123});get(0).foo;setProperty(0, 'foo', 999);get(0).foo}" << 999 << "" << dr;

QTest::newRow("append1") << "{append({'foo':123});count}" << 1 << "" << dr;
QTest::newRow("append2") << "{append({'foo':123,'bar':456});count}" << 1 << "" << dr;
Expand Down

0 comments on commit b63ee00

Please sign in to comment.