The plugin is cleaned up by the plugin loader so don't double-delete
authorGunnar Sletta <gunnar.sletta@nokia.com>
Fri, 24 Feb 2012 11:23:51 +0000 (12:23 +0100)
committerQt by Nokia <qt-info@nokia.com>
Fri, 24 Feb 2012 13:05:17 +0000 (14:05 +0100)
Change-Id: I8bac5b6e1960cbc38575c76f02aa6c6c90700331
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/quick/scenegraph/qsgcontextplugin.cpp

index 026afb2..6382d42 100644 (file)
@@ -71,7 +71,6 @@ struct QSGAdaptionPluginData
 
     ~QSGAdaptionPluginData()
     {
-        delete factory;
     }
 
     bool tried;
@@ -102,15 +101,15 @@ QSGAdaptionPluginData *contextFactory()
         if (!device.isEmpty()) {
             plugin->factory = qobject_cast<QSGContextFactoryInterface*>(loader()->instance(device));
             plugin->deviceName = device;
-        }
 #ifndef QT_NO_DEBUG
-        if (!device.isEmpty()) {
-            qWarning("Could not create scene graph context for device '%s'"
-                     " - check that plugins are installed correctly in %s",
-                     qPrintable(device),
-                     qPrintable(QLibraryInfo::location(QLibraryInfo::PluginsPath)));
-        }
+            if (!plugin->factory) {
+                qWarning("Could not create scene graph context for device '%s'"
+                         " - check that plugins are installed correctly in %s",
+                         qPrintable(device),
+                         qPrintable(QLibraryInfo::location(QLibraryInfo::PluginsPath)));
+            }
 #endif
+        }
 
 #endif // QT_NO_LIBRARY || QT_NO_SETTINGS
     }