diff options
author | Philip Lorenz <philip@bithub.de> | 2012-12-01 12:58:39 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-10 18:09:27 +0100 |
commit | c18e04b2e61f174a4883f6884cf9a0712c5725e3 (patch) | |
tree | 1be41c4bd81b01519b0cf3d54fcbd17a10842fc7 /src/qml/qml/v8/qv8contextwrapper_p.h | |
parent | 22924ac4fe1962022ec12f40c66bf5cb988515b3 (diff) |
Only free context if the owning QV8ContextResource gets destroyed
Since fdeee38b781376012c4f086276c3c376726c8839 QQmlXMLHttpRequest stores
the calling context for later use. This leads to issues after the first
request completes and the wrapping QV8ContextResource gets freed by
garbage collection and therefore removes the associated QQmlDataContext
which may still be required for later calls (e.g. if the calling context
is part of a stateless library).
This patch introduces an ownership flag for QV8ContextResource which
indicates if the associated context should be cleared when the object is
destroyed.
Task-number: QTBUG-28351
Change-Id: I552ebb5c55b889eb33f3884283c8fdf037ac33be
Reviewed-by: Alan Alpert <aalpert@rim.com>
Diffstat (limited to 'src/qml/qml/v8/qv8contextwrapper_p.h')
-rw-r--r-- | src/qml/qml/v8/qv8contextwrapper_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/qml/v8/qv8contextwrapper_p.h b/src/qml/qml/v8/qv8contextwrapper_p.h index 1e62ea6480..43eeee05d3 100644 --- a/src/qml/qml/v8/qv8contextwrapper_p.h +++ b/src/qml/qml/v8/qv8contextwrapper_p.h @@ -54,6 +54,7 @@ // #include <QtCore/qglobal.h> +#include <private/qtqmlglobal_p.h> #include <private/qv8_p.h> QT_BEGIN_NAMESPACE @@ -62,7 +63,7 @@ class QUrl; class QObject; class QV8Engine; class QQmlContextData; -class QV8ContextWrapper +class Q_QML_PRIVATE_EXPORT QV8ContextWrapper { public: QV8ContextWrapper(); @@ -84,6 +85,8 @@ public: inline v8::Handle<v8::Object> sharedContext() const; + void takeContextOwnership(v8::Handle<v8::Object> qmlglobal); + private: static v8::Handle<v8::Value> NullGetter(v8::Local<v8::String> property, const v8::AccessorInfo &info); |