From 73a8f5f4845d34d74470b5a524d655be9eaf6dfc Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 10 Nov 2014 10:50:37 +0100 Subject: Cleanup debugger to be safe for the new GC Added a bit of convenience to PersistentValue as well. Change-Id: I5a858079543b41ce1ef48a84e9350a7d6fa64501 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4persistent.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/qml/jsruntime/qv4persistent.cpp') diff --git a/src/qml/jsruntime/qv4persistent.cpp b/src/qml/jsruntime/qv4persistent.cpp index ff10d71aae..af15804e1f 100644 --- a/src/qml/jsruntime/qv4persistent.cpp +++ b/src/qml/jsruntime/qv4persistent.cpp @@ -89,6 +89,16 @@ PersistentValue &PersistentValue::operator =(ReturnedValue other) return *this; } +PersistentValue &PersistentValue::operator=(Heap::Base *obj) +{ + if (!d) { + d = new PersistentValuePrivate(Value::fromHeapObject(obj).asReturnedValue()); + return *this; + } + d = d->detach(Value::fromHeapObject(obj).asReturnedValue()); + return *this; +} + PersistentValue::~PersistentValue() { if (d) -- cgit v1.2.3