diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2013-02-28 12:41:03 -0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-01 17:29:13 +0100 |
commit | 9ae561d7fe7513fe682b48dfdda3932f2533b829 (patch) | |
tree | 894ee8016c3f1c02672680b07f3fd72aca384eef /src/qml/qml/qqmlglobal_p.h | |
parent | fa130d2e20b1b0d8048bff154243b9ddce0d1236 (diff) |
Fix the QtQml's use of plugins for value type providers
When the QtQuick library is loaded, it runs a global constructor that
installs the QtQuick value providers. But those providers are never
uninstalled when the library is unloaded, resulting in a dangling
pointer stored in QtQml's singly-linked list of value providers.
Since cafb02911a29b98ac2652fde64e95870e70fd547, QLibrary will unload
plugins after inspecting their plugin metadata on Mac and Windows. If
QtQml is trying to load a plugin that links to QtQuick (in particular,
*the* qtquick2plugin plugin), it would cause the value provider to go
stale.
To make matters worse, it's quite likely that the plugin would get
loaded soon after, at the same address in memory, which causes the
valueTypeProvider list to become cyclic.
Change-Id: I6f4db5475ceeaba766d9e9c78f86266c9a65806a
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlglobal_p.h')
-rw-r--r-- | src/qml/qml/qqmlglobal_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h index 0ce026a558..f6b2c81536 100644 --- a/src/qml/qml/qqmlglobal_p.h +++ b/src/qml/qml/qqmlglobal_p.h @@ -271,6 +271,7 @@ private: virtual bool write(int, const void *, void *, size_t); friend Q_QML_PRIVATE_EXPORT void QQml_addValueTypeProvider(QQmlValueTypeProvider *); + friend Q_QML_PRIVATE_EXPORT void QQml_removeValueTypeProvider(QQmlValueTypeProvider *); QQmlValueTypeProvider *next; }; |