summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorCasper van Donderen <casper.vandonderen@nokia.com>2011-09-30 08:55:26 (GMT)
committerCasper van Donderen <casper.vandonderen@nokia.com>2011-09-30 08:55:26 (GMT)
commita3a5566678256a029893fdfbc0c977e68bb61f2e (patch)
treeee09839c6ce95645da511c5ebd91d19586649976 /src/declarative/qml
parent7e6bf4a06e6f2e8e3a25d1212be766e2e753347a (diff)
parent1f459f4040845919ffd46cea35958486f41abb3c (diff)
downloadQt-a3a5566678256a029893fdfbc0c977e68bb61f2e.zip
Qt-a3a5566678256a029893fdfbc0c977e68bb61f2e.tar.gz
Qt-a3a5566678256a029893fdfbc0c977e68bb61f2e.tar.bz2
Merge remote-tracking branch 'mainline/4.8'
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp2
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings.cpp12
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings_p.h2
-rw-r--r--src/declarative/qml/qdeclarativevme.cpp2
4 files changed, 14 insertions, 4 deletions
diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp
index 689cd00..9359196 100644
--- a/src/declarative/qml/qdeclarativebinding.cpp
+++ b/src/declarative/qml/qdeclarativebinding.cpp
@@ -254,6 +254,8 @@ QDeclarativeBinding::createBinding(Identifier id, QObject *obj, QDeclarativeCont
cdata = typeData->compiledData();
}
QDeclarativeBinding *rv = cdata ? new QDeclarativeBinding((void*)cdata->datas.at(id).constData(), cdata, obj, ctxtdata, url, lineNumber, parent) : 0;
+ if (cdata)
+ cdata->release();
if (typeData)
typeData->release();
return rv;
diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp
index 51ffc10..72a3e53 100644
--- a/src/declarative/qml/qdeclarativecompiledbindings.cpp
+++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp
@@ -235,6 +235,7 @@ public:
void run(Binding *, QDeclarativePropertyPrivate::WriteFlags flags);
const char *programData;
+ QDeclarativeRefCount *dataRef;
Binding *m_bindings;
quint32 *m_signalTable;
@@ -267,7 +268,7 @@ public:
};
QDeclarativeCompiledBindingsPrivate::QDeclarativeCompiledBindingsPrivate()
-: subscriptions(0), identifiers(0)
+: subscriptions(0), identifiers(0), programData(0), dataRef(0), m_bindings(0), m_signalTable(0)
{
}
@@ -275,11 +276,16 @@ QDeclarativeCompiledBindingsPrivate::~QDeclarativeCompiledBindingsPrivate()
{
delete [] subscriptions; subscriptions = 0;
delete [] identifiers; identifiers = 0;
+ if (dataRef) {
+ dataRef->release();
+ dataRef = 0;
+ }
}
int QDeclarativeCompiledBindingsPrivate::methodCount = -1;
-QDeclarativeCompiledBindings::QDeclarativeCompiledBindings(const char *program, QDeclarativeContextData *context)
+QDeclarativeCompiledBindings::QDeclarativeCompiledBindings(const char *program, QDeclarativeContextData *context,
+ QDeclarativeRefCount *dataRef)
: QObject(*(new QDeclarativeCompiledBindingsPrivate))
{
Q_D(QDeclarativeCompiledBindings);
@@ -288,6 +294,8 @@ QDeclarativeCompiledBindings::QDeclarativeCompiledBindings(const char *program,
d->methodCount = QDeclarativeCompiledBindings::staticMetaObject.methodCount();
d->programData = program;
+ d->dataRef = dataRef;
+ if (d->dataRef) d->dataRef->addref();
d->init();
diff --git a/src/declarative/qml/qdeclarativecompiledbindings_p.h b/src/declarative/qml/qdeclarativecompiledbindings_p.h
index e7b6937..8ec0ac3 100644
--- a/src/declarative/qml/qdeclarativecompiledbindings_p.h
+++ b/src/declarative/qml/qdeclarativecompiledbindings_p.h
@@ -95,7 +95,7 @@ class QDeclarativeCompiledBindingsPrivate;
class QDeclarativeCompiledBindings : public QObject, public QDeclarativeAbstractExpression, public QDeclarativeRefCount
{
public:
- QDeclarativeCompiledBindings(const char *program, QDeclarativeContextData *context);
+ QDeclarativeCompiledBindings(const char *program, QDeclarativeContextData *context, QDeclarativeRefCount *);
virtual ~QDeclarativeCompiledBindings();
QDeclarativeAbstractBinding *configBinding(int index, QObject *target, QObject *scope, int property);
diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp
index a23f89d..8cf97d2 100644
--- a/src/declarative/qml/qdeclarativevme.cpp
+++ b/src/declarative/qml/qdeclarativevme.cpp
@@ -209,7 +209,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEObjectStack &stack,
if (instr.init.contextCache != -1)
ctxt->setIdPropertyData(comp->contextCaches.at(instr.init.contextCache));
if (instr.init.compiledBinding != -1)
- ctxt->optimizedBindings = new QDeclarativeCompiledBindings(datas.at(instr.init.compiledBinding).constData(), ctxt);
+ ctxt->optimizedBindings = new QDeclarativeCompiledBindings(datas.at(instr.init.compiledBinding).constData(), ctxt, comp);
}
break;