diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-06-08 14:32:39 +1000 |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-06-08 14:32:39 +1000 |
commit | 8902609a7e6cc27fceff15aa80547f1137efd7c9 (patch) | |
tree | 5cceabf2176d66260a4e6a600fbdf7c8f4002c80 /src/declarative/qml/v8/qv8variantwrapper.cpp | |
parent | 96cfe77fa311e60a2dfb7967d7ad6c06d40b99fb (diff) |
Implement global handle tracking
This makes it easier to track down handles that have been double
Dispose()'d. See qv8engine_p.h for details.
Diffstat (limited to 'src/declarative/qml/v8/qv8variantwrapper.cpp')
-rw-r--r-- | src/declarative/qml/v8/qv8variantwrapper.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/declarative/qml/v8/qv8variantwrapper.cpp b/src/declarative/qml/v8/qv8variantwrapper.cpp index de3cb11926..ef1f972ad1 100644 --- a/src/declarative/qml/v8/qv8variantwrapper.cpp +++ b/src/declarative/qml/v8/qv8variantwrapper.cpp @@ -74,11 +74,11 @@ void QV8VariantWrapper::init(QV8Engine *engine) v8::Local<v8::FunctionTemplate> ft = v8::FunctionTemplate::New(); ft->InstanceTemplate()->SetNamedPropertyHandler(Getter, Setter); ft->InstanceTemplate()->SetHasExternalResource(true); - m_constructor = v8::Persistent<v8::Function>::New(ft->GetFunction()); + m_constructor = qPersistentNew<v8::Function>(ft->GetFunction()); } { - m_preserve = v8::Persistent<v8::Function>::New(v8::FunctionTemplate::New(Preserve)->GetFunction()); - m_destroy = v8::Persistent<v8::Function>::New(v8::FunctionTemplate::New(Destroy)->GetFunction()); + m_preserve = qPersistentNew<v8::Function>(v8::FunctionTemplate::New(Preserve)->GetFunction()); + m_destroy = qPersistentNew<v8::Function>(v8::FunctionTemplate::New(Destroy)->GetFunction()); v8::Local<v8::FunctionTemplate> ft = v8::FunctionTemplate::New(); ft->InstanceTemplate()->SetFallbackPropertyHandler(Getter, Setter); ft->InstanceTemplate()->SetHasExternalResource(true); @@ -88,17 +88,17 @@ void QV8VariantWrapper::init(QV8Engine *engine) ft->InstanceTemplate()->SetAccessor(v8::String::New("destroy"), DestroyGetter, 0, m_destroy, v8::DEFAULT, v8::PropertyAttribute(v8::ReadOnly | v8::DontDelete)); - m_scarceConstructor = v8::Persistent<v8::Function>::New(ft->GetFunction()); + m_scarceConstructor = qPersistentNew<v8::Function>(ft->GetFunction()); } } void QV8VariantWrapper::destroy() { - m_destroy.Dispose(); m_destroy.Clear(); - m_preserve.Dispose(); m_preserve.Clear(); - m_scarceConstructor.Dispose(); m_scarceConstructor.Clear(); - m_constructor.Dispose(); m_constructor.Clear(); + qPersistentDispose(m_destroy); + qPersistentDispose(m_preserve); + qPersistentDispose(m_scarceConstructor); + qPersistentDispose(m_constructor); } v8::Local<v8::Object> QV8VariantWrapper::newVariant(const QVariant &value) |