aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/debugger
diff options
context:
space:
mode:
authorAurindam Jana <aurindam.jana@nokia.com>2011-11-17 12:19:45 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-17 16:53:24 +0100
commit1bc5117533b09548f7b669a47ae4657b2d22f561 (patch)
treeefa0bb1a80115eb06ab5b7f9c61347ffdf56a057 /src/declarative/debugger
parent8a04cc7dc6707d3ee11565fe2c3d76fdce98187f (diff)
QDeclarativeDebugServer: Crash Fix
Instantiate QPluginLoader on heap. Change-Id: I53a7cb669379d374e8b6f83fe998c0bb17fbce33 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'src/declarative/debugger')
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp
index a4f5bd28f0..5c86c45116 100644
--- a/src/declarative/debugger/qdeclarativedebugserver.cpp
+++ b/src/declarative/debugger/qdeclarativedebugserver.cpp
@@ -98,7 +98,8 @@ public:
private:
// private slot
void _q_deliverMessage(const QString &serviceName, const QByteArray &message);
- static QDeclarativeDebugServerConnection *loadConnectionPlugin(const QString &pluginName);
+ static QDeclarativeDebugServerConnection *loadConnectionPlugin(QPluginLoader *loader, const QString &pluginName);
+
};
QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() :
@@ -122,7 +123,7 @@ void QDeclarativeDebugServerPrivate::advertisePlugins()
}
QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectionPlugin(
- const QString &pluginName)
+ QPluginLoader *loader, const QString &pluginName)
{
#ifndef QT_NO_LIBRARY
QStringList pluginCandidates;
@@ -142,14 +143,14 @@ QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectio
if (qmlDebugVerbose())
qDebug() << "QDeclarativeDebugServer: Trying to load plugin " << pluginPath << "...";
- QPluginLoader loader(pluginPath);
- if (!loader.load()) {
+ loader->setFileName(pluginPath);
+ if (!loader->load()) {
if (qmlDebugVerbose())
- qDebug() << "QDeclarativeDebugServer: Error while loading: " << loader.errorString();
+ qDebug() << "QDeclarativeDebugServer: Error while loading: " << loader->errorString();
continue;
}
QDeclarativeDebugServerConnection *connection = 0;
- if (QObject *instance = loader.instance())
+ if (QObject *instance = loader->instance())
connection = qobject_cast<QDeclarativeDebugServerConnection*>(instance);
if (connection) {
@@ -162,7 +163,7 @@ QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectio
if (qmlDebugVerbose())
qDebug() << "QDeclarativeDebugServer: Plugin does not implement interface QDeclarativeDebugServerConnection.";
- loader.unload();
+ loader->unload();
}
#endif
return 0;
@@ -215,9 +216,9 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance()
if (ok) {
server = new QDeclarativeDebugServer();
-
+ QPluginLoader *loader = new QPluginLoader(server);
QDeclarativeDebugServerConnection *connection
- = QDeclarativeDebugServerPrivate::loadConnectionPlugin(pluginName);
+ = QDeclarativeDebugServerPrivate::loadConnectionPlugin(loader, pluginName);
if (connection) {
server->d_func()->connection = connection;