summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin
diff options
context:
space:
mode:
authorJoão Abecasis <joao@abecasis.name>2009-07-10 13:36:02 (GMT)
committerJoão Abecasis <joao@abecasis.name>2009-07-13 10:16:44 (GMT)
commit486bd135faa2c8269044f9c03597bc6b05644540 (patch)
treeaaf9690c4e3f18896ae57a40eb5e7712005ecea5 /src/corelib/plugin
parentb9ea022e206bad5d80b4b9a7b957e8b8521d9fb9 (diff)
downloadQt-486bd135faa2c8269044f9c03597bc6b05644540.zip
Qt-486bd135faa2c8269044f9c03597bc6b05644540.tar.gz
Qt-486bd135faa2c8269044f9c03597bc6b05644540.tar.bz2
Revert "Fixed leak of plugin instances"
mjansen reported on #qt-labs that this change crashes KDE applications that were calling delete on their plugins. It turns out that is also how QPluginLoader works, so the commit was a bad idea to start with. This reverts commit 4c7004122a858cd6d891efc7923ba11484fbf997. Reviewed-by: Thiago Macieira
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r--src/corelib/plugin/qplugin.h19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h
index ff2b412..233b4f9 100644
--- a/src/corelib/plugin/qplugin.h
+++ b/src/corelib/plugin/qplugin.h
@@ -63,21 +63,6 @@ typedef QObject *(*QtPluginInstanceFunction)();
void Q_CORE_EXPORT qRegisterStaticPluginInstanceFunction(QtPluginInstanceFunction function);
-struct qt_plugin_instance_deleter
-{
- qt_plugin_instance_deleter(QPointer<QObject> &instance)
- : instance_(instance)
- {
- }
-
- ~qt_plugin_instance_deleter()
- {
- delete instance_;
- }
-
- QPointer<QObject> &instance_;
-};
-
#define Q_IMPORT_PLUGIN(PLUGIN) \
extern QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance_##PLUGIN(); \
class Static##PLUGIN##PluginInstance{ \
@@ -91,10 +76,8 @@ struct qt_plugin_instance_deleter
#define Q_PLUGIN_INSTANCE(IMPLEMENTATION) \
{ \
static QT_PREPEND_NAMESPACE(QPointer)<QT_PREPEND_NAMESPACE(QObject)> _instance; \
- if (!_instance) { \
- static QT_PREPEND_NAMESPACE(qt_plugin_instance_deleter) deleter(_instance); \
+ if (!_instance) \
_instance = new IMPLEMENTATION; \
- } \
return _instance; \
}