summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qmlexpression.cpp7
-rw-r--r--src/declarative/qml/qmlexpression_p.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp
index ff1705b..6f32ef4 100644
--- a/src/declarative/qml/qmlexpression.cpp
+++ b/src/declarative/qml/qmlexpression.cpp
@@ -71,7 +71,7 @@ bool QmlDelayedError::addError(QmlEnginePrivate *e)
}
QmlExpressionData::QmlExpressionData()
-: expressionFunctionValid(false), expressionRewritten(false), me(0),
+: q(0), dataRef(0), expressionFunctionValid(false), expressionRewritten(false), me(0),
trackChange(true), isShared(false), line(-1), guardList(0), guardListLength(0)
{
}
@@ -79,6 +79,7 @@ QmlExpressionData::QmlExpressionData()
QmlExpressionData::~QmlExpressionData()
{
if (guardList) { delete [] guardList; guardList = 0; }
+ if (dataRef) dataRef->release();
}
QmlExpressionPrivate::QmlExpressionPrivate()
@@ -113,6 +114,10 @@ void QmlExpressionPrivate::init(QmlContext *ctxt, void *expr, QmlRefCount *rc,
data->url = url;
data->line = lineNumber;
+ if (data->dataRef) data->dataRef->release();
+ data->dataRef = rc;
+ if (data->dataRef) data->dataRef->addref();
+
quint32 *exprData = (quint32 *)expr;
QmlCompiledData *dd = (QmlCompiledData *)rc;
diff --git a/src/declarative/qml/qmlexpression_p.h b/src/declarative/qml/qmlexpression_p.h
index 1fbb075..b19c60c 100644
--- a/src/declarative/qml/qmlexpression_p.h
+++ b/src/declarative/qml/qmlexpression_p.h
@@ -114,6 +114,7 @@ public:
QmlExpressionPrivate *q;
+ QmlRefCount *dataRef;
QString expression;
bool expressionFunctionValid:1;
bool expressionRewritten:1;