diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-11-05 22:49:00 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-11-05 22:49:00 (GMT) |
commit | ec543f79c7d036961eb6cdcd956b3e8ca28b8e54 (patch) | |
tree | 8af5b0ddb2176ea68085fb12614149e4f884797c /src/declarative | |
parent | 656870157932a0b44de69927faa003c71eeb2a47 (diff) | |
download | Qt-ec543f79c7d036961eb6cdcd956b3e8ca28b8e54.zip Qt-ec543f79c7d036961eb6cdcd956b3e8ca28b8e54.tar.gz Qt-ec543f79c7d036961eb6cdcd956b3e8ca28b8e54.tar.bz2 |
Fix possible crash when overriding a signal handler.
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qmlboundsignal.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qmlpropertychanges.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/declarative/qml/qmlboundsignal.cpp b/src/declarative/qml/qmlboundsignal.cpp index def11c3..deb15dc 100644 --- a/src/declarative/qml/qmlboundsignal.cpp +++ b/src/declarative/qml/qmlboundsignal.cpp @@ -177,7 +177,7 @@ int QmlBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) if (m_params) m_params->setValues(a); if (m_expression) { QmlExpressionPrivate::get(m_expression)->value(m_params); - if (m_expression->hasError()) + if (m_expression && m_expression->hasError()) qWarning().nospace() << qPrintable(m_expression->error().toString()); } if (m_params) m_params->clearValues(); diff --git a/src/declarative/util/qmlpropertychanges.cpp b/src/declarative/util/qmlpropertychanges.cpp index 3cc6ca9..3aa3678 100644 --- a/src/declarative/util/qmlpropertychanges.cpp +++ b/src/declarative/util/qmlpropertychanges.cpp @@ -232,7 +232,7 @@ void QmlPropertyChangesPrivate::decode() ds >> data; QmlMetaProperty prop = property(name); //### better way to check for signal property? - if (prop.type() == QmlMetaProperty::SignalProperty) { + if (prop.type() & QmlMetaProperty::SignalProperty) { QmlExpression *expression = new QmlExpression(qmlContext(q), data.toString(), object); expression->setTrackChange(false); QmlReplaceSignalHandler *handler = new QmlReplaceSignalHandler; @@ -307,7 +307,7 @@ QmlPropertyChangesPrivate::property(const QByteArray &property) if (!prop.isValid()) { qmlInfo(QmlPropertyChanges::tr("Cannot assign to non-existant property \"%1\"").arg(QString::fromUtf8(property)), q); return QmlMetaProperty(); - } else if (prop.type() != QmlMetaProperty::SignalProperty && !prop.isWritable()) { + } else if (!(prop.type() & QmlMetaProperty::SignalProperty) && !prop.isWritable()) { qmlInfo(QmlPropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(QString::fromUtf8(property)), q); return QmlMetaProperty(); } |