diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-11-10 10:50:37 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-11-12 12:13:20 +0100 |
commit | 73a8f5f4845d34d74470b5a524d655be9eaf6dfc (patch) | |
tree | b3ff01f6e3f7f8c51eaab36d868fbcff6fe5384b /src/qml/jsruntime/qv4persistent.cpp | |
parent | 943583ca408f5d419de03e54aab48557f5e5bebb (diff) |
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 <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4persistent.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4persistent.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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) |