diff options
author | Simon Hausmann <[email protected]> | 2014-03-04 16:15:26 +0100 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-03-05 15:01:07 +0100 |
commit | e4e4a7912b03499a20f25e261e1c515aab17e5a8 (patch) | |
tree | 412e643b91e0445b64fe4389c51359bb17195be1 /src/qml/compiler/qv4compileddata_p.h | |
parent | 0d84dab38059345f51e8318d2474068e817ac007 (diff) |
[new compiler] Fix invalid memory reads when JS closures outlive QML types
If QQmlCompiledData gets destroyed while somebody still has refcount on the
QV4::CompiledData::CompilationUnit, then unit's _data_ would be freed already
by ~QQmlCompiledData. Given that compilationUnit->data is pointing to the same
malloc'ed address as QQmlCompiledData::qmlUnit, we can just let the
CompilationUnit always own the data.
Fixes tst_qquickloader and makes it possible to run the qquickcomponent tests.
Change-Id: Ie3f3e5335139236d7c2524a327665bda0a9cc847
Reviewed-by: Lars Knoll <[email protected]>
Diffstat (limited to 'src/qml/compiler/qv4compileddata_p.h')
-rw-r--r-- | src/qml/compiler/qv4compileddata_p.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index 026ce630d2..dec2bb8137 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -549,7 +549,6 @@ struct Q_QML_EXPORT CompilationUnit : refCount(0) , engine(0) , data(0) - , ownsData(false) , runtimeStrings(0) , runtimeLookups(0) , runtimeRegularExpressions(0) @@ -563,7 +562,6 @@ struct Q_QML_EXPORT CompilationUnit int refCount; ExecutionEngine *engine; Unit *data; - bool ownsData; QString fileName() const { return data->stringAt(data->sourceFileIndex); } |