aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4persistent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4persistent.cpp')
-rw-r--r--src/qml/jsruntime/qv4persistent.cpp10
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)