History

Work on fixing V8 memory leaks, memory leak test

ksuprynowicz committed 3 years ago

Commit 42704ea1 parent f016a199 files · +46 −3Browse files

Showing the changes to libraries/script-engine/src/v8/ScriptEngineV8_cast.cpp (1 of 9 files). Show all

Unified · Split

libraries/script-engine/src/v8/ScriptEngineV8_cast.cpp+3−1
@@ -750,6 +750,7 @@ V8ScriptValue ScriptEngineV8::castVariantToValue(const QVariant& val) { · 749 unmodified lines
750750 case QMetaType::QObjectStar: {
751751 QObject* obj = val.value<QObject*>();
752752 if (obj == nullptr) return V8ScriptValue(this, v8::Null(_v8Isolate));
753+ //V8TODO: what should be the ownership in this case?
753754 return ScriptObjectV8Proxy::newQObject(this, obj);
754755 }
755756 case QMetaType::QDateTime:
@@ -768,9 +769,10 @@ V8ScriptValue ScriptEngineV8::castVariantToValue(const QVariant& val) { · 12 unmodified lines
768769 if (QMetaType::typeFlags(valTypeId) & (QMetaType::PointerToQObject | QMetaType::TrackingPointerToQObject)) {
769770 QObject* obj = val.value<QObject*>();
770771 if (obj == nullptr) return V8ScriptValue(this, v8::Null(_v8Isolate));
772+ //V8TODO: what should be the ownership in this case?
771773 return ScriptObjectV8Proxy::newQObject(this, obj);
772774 }
773− // have we set a prototype'd variant?
775+ // have we set a prototyped variant?
774776 {
775777 _customTypeProtect.lockForRead();
776778 CustomPrototypeMap::const_iterator lookup = _customPrototypes.find(valTypeId);