aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-10-15 15:00:24 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-15 20:57:37 +0200
commitb538231cb2409d9d6eb87161930b53b004aed3ac (patch)
tree7a8bc0d0a2d4349f963459325294ea49a6b1b1fb /src/qml/jsruntime/qv4engine.cpp
parente20253ed7a11ac65594ca88c933739d6c01b446d (diff)
Fix GC issues with usage of raw RegExp pointers
Properly protect them through Scoped values. Change-Id: I5a0a1d5580d55ecff493419baa8959751a65f1d3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 6257d8bac9..2ddc07d63c 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -464,10 +464,12 @@ Returned<RegExpObject> *ExecutionEngine::newRegExpObject(const QString &pattern,
if (flags & QQmlJS::V4IR::RegExp::RegExp_Multiline)
multiline = true;
- return newRegExpObject(RegExp::create(this, pattern, ignoreCase, multiline), global);
+ Scope scope(this);
+ Scoped<RegExp> re(scope, RegExp::create(this, pattern, ignoreCase, multiline));
+ return newRegExpObject(re, global);
}
-Returned<RegExpObject> *ExecutionEngine::newRegExpObject(RegExp* re, bool global)
+Returned<RegExpObject> *ExecutionEngine::newRegExpObject(Referenced<RegExp> re, bool global)
{
RegExpObject *object = new (memoryManager) RegExpObject(this, re, global);
return object->asReturned<RegExpObject>();