aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8/qjsvalue_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-06-17 13:35:07 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-06-17 13:37:47 +0200
commit3436b58928b52c1cef643202969159324b8f0850 (patch)
treeba7a4ade72799ac7158f78e0d5af97f4330f205d /src/qml/qml/v8/qjsvalue_p.h
parent227f7ed60cfb34f7c3d91b27b07ddc5bbd1a2922 (diff)
Fix memory corruption in qjsvalueprivate
When converting to a memory managed string, we need to add the PersistentValuePrivate to the chain of persistent objects. Otherwise the string stored in the JSValue can get garbage collected. Change-Id: I159fd77a7ae6f29e4121969cac962bd12b0f9bc7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/v8/qjsvalue_p.h')
-rw-r--r--src/qml/qml/v8/qjsvalue_p.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/qml/qml/v8/qjsvalue_p.h b/src/qml/qml/v8/qjsvalue_p.h
index 3b05af21e8..a1cd471785 100644
--- a/src/qml/qml/v8/qjsvalue_p.h
+++ b/src/qml/qml/v8/qjsvalue_p.h
@@ -89,17 +89,7 @@ public:
value = QV4::Value::fromString(&string);
}
- QV4::Value getValue(QV4::ExecutionEngine *e) {
- if (!this->e)
- this->e = e;
- else if (this->e != e) {
- qWarning("JSValue can't be reassigned to another engine.");
- return QV4::Value::emptyValue();
- }
- if (value.asString() == &string)
- value = QV4::Value::fromString(e->newString(string.toQString()));
- return value;
- }
+ QV4::Value getValue(QV4::ExecutionEngine *e);
bool checkEngine(QV4::ExecutionEngine *otherEngine) {
if (!e) {