diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-09-15 07:42:23 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-09-15 07:42:23 (GMT) |
commit | 981f42a050de75a5f3547006e96a9fca188809b2 (patch) | |
tree | 4adb2898c72a3d19cb2797dfbabcbe130d25e860 /src/declarative | |
parent | 704dd92581783d91ccd234d58896d7078eed14a5 (diff) | |
parent | 44d30ae2968846bd820b8bb5d1128a8b7a2d4207 (diff) | |
download | Qt-981f42a050de75a5f3547006e96a9fca188809b2.zip Qt-981f42a050de75a5f3547006e96a9fca188809b2.tar.gz Qt-981f42a050de75a5f3547006e96a9fca188809b2.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-qml-staging:
Fix crash in compiled bindings
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativecompiledbindings.cpp | 12 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativecompiledbindings_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativevme.cpp | 2 |
3 files changed, 12 insertions, 4 deletions
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; |