From b538231cb2409d9d6eb87161930b53b004aed3ac Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 15 Oct 2013 15:00:24 +0200 Subject: Fix GC issues with usage of raw RegExp pointers Properly protect them through Scoped values. Change-Id: I5a0a1d5580d55ecff493419baa8959751a65f1d3 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4engine.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/qml/jsruntime/qv4engine.cpp') 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 *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 re(scope, RegExp::create(this, pattern, ignoreCase, multiline)); + return newRegExpObject(re, global); } -Returned *ExecutionEngine::newRegExpObject(RegExp* re, bool global) +Returned *ExecutionEngine::newRegExpObject(Referenced re, bool global) { RegExpObject *object = new (memoryManager) RegExpObject(this, re, global); return object->asReturned(); -- cgit v1.2.3