summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlmetaproperty.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/qmlmetaproperty.cpp')
-rw-r--r--src/declarative/qml/qmlmetaproperty.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp
index 5938384..d7d4a07 100644
--- a/src/declarative/qml/qmlmetaproperty.cpp
+++ b/src/declarative/qml/qmlmetaproperty.cpp
@@ -276,7 +276,7 @@ const char *QmlMetaProperty::propertyTypeName() const
{
if (type() & ValueTypeProperty) {
- QmlEnginePrivate *ep = d->context?QmlEnginePrivate::get(d->context->engine()):0;
+ QmlEnginePrivate *ep = QmlEnginePrivate::get(d->context);
QmlValueType *valueType = 0;
if (ep) valueType = ep->valueTypes[d->core.propType];
else valueType = QmlValueTypeFactory::valueType(d->core.propType);
@@ -689,7 +689,7 @@ QVariant QmlMetaPropertyPrivate::readValueProperty()
} else if(type & QmlMetaProperty::ValueTypeProperty) {
- QmlEnginePrivate *ep = context?QmlEnginePrivate::get(context->engine()):0;
+ QmlEnginePrivate *ep = QmlEnginePrivate::get(context);
QmlValueType *valueType = 0;
if (ep) valueType = ep->valueTypes[core.propType];
else valueType = QmlValueTypeFactory::valueType(core.propType);
@@ -754,14 +754,15 @@ bool QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value,
QmlMetaProperty::WriteFlags flags)
{
// Remove any existing bindings on this property
- if (!(flags & QmlMetaProperty::DontRemoveBinding))
- delete q->setBinding(0);
+ if (!(flags & QmlMetaProperty::DontRemoveBinding)) {
+ QmlAbstractBinding *binding = q->setBinding(0);
+ if (binding) binding->destroy();
+ }
bool rv = false;
uint type = q->type();
if (type & QmlMetaProperty::ValueTypeProperty) {
- QmlEnginePrivate *ep =
- context?static_cast<QmlEnginePrivate *>(QObjectPrivate::get(context->engine())):0;
+ QmlEnginePrivate *ep = QmlEnginePrivate::get(context);
QmlValueType *writeBack = 0;
if (ep) {