summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristiaan Janssen <christiaan.janssen@digia.com>2013-06-05 10:48:16 +0200
committerChristiaan Janssen <christiaan.janssen@digia.com>2013-06-05 12:41:16 +0200
commit485315ec67258a6f0bc99811eeddfa553d529989 (patch)
tree11b765212d4b1c3d41f6758a795442081698a505
parent570320fecd72aeaeb832aeb6d4e162f13a43538d (diff)
downloadqt-creator-485315ec67258a6f0bc99811eeddfa553d529989.tar.gz
QmlProfiler: fix potential crash
fixes Ib2ea66bd5694046577a0b5a0e2f611f3ffba0238 Change-Id: Ib7a4e02391513984f1c81a43a5fab490b7f88923 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
-rw-r--r--src/plugins/qmlprofiler/localqmlprofilerrunner.cpp5
-rw-r--r--src/plugins/qmlprofiler/localqmlprofilerrunner.h1
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerengine.cpp4
3 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp b/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp
index d6b3dccf97..a7883f506c 100644
--- a/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp
+++ b/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp
@@ -41,6 +41,11 @@ LocalQmlProfilerRunner::LocalQmlProfilerRunner(const Configuration &configuratio
this, SIGNAL(appendMessage(QString,Utils::OutputFormat)));
}
+LocalQmlProfilerRunner::~LocalQmlProfilerRunner()
+{
+ disconnect();
+}
+
void LocalQmlProfilerRunner::start()
{
QString arguments = QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(m_configuration.port);
diff --git a/src/plugins/qmlprofiler/localqmlprofilerrunner.h b/src/plugins/qmlprofiler/localqmlprofilerrunner.h
index 042df14625..26a9b45161 100644
--- a/src/plugins/qmlprofiler/localqmlprofilerrunner.h
+++ b/src/plugins/qmlprofiler/localqmlprofilerrunner.h
@@ -52,6 +52,7 @@ public:
};
explicit LocalQmlProfilerRunner(const Configuration &configuration, QObject *parent = 0);
+ ~LocalQmlProfilerRunner();
// AbstractQmlProfilerRunner
virtual void start();
diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp
index f5800869f4..6914286dc6 100644
--- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp
@@ -61,7 +61,7 @@ class QmlProfilerEngine::QmlProfilerEnginePrivate
{
public:
QmlProfilerEnginePrivate(QmlProfilerEngine *qq) : q(qq), m_runner(0) {}
- ~QmlProfilerEnginePrivate() { m_runner->disconnect(); delete m_runner; }
+ ~QmlProfilerEnginePrivate() { delete m_runner; }
bool attach(const QString &address, uint port);
static AbstractQmlProfilerRunner *createRunner(ProjectExplorer::RunConfiguration *runConfiguration,
@@ -153,7 +153,6 @@ bool QmlProfilerEngine::start()
QTC_ASSERT(d->m_profilerState, return false);
if (d->m_runner) {
- d->m_runner->disconnect();
delete d->m_runner;
d->m_runner = 0;
}
@@ -365,7 +364,6 @@ void QmlProfilerEngine::profilerStateChanged()
// (a new one will be created at start)
d->m_noDebugOutputTimer.stop();
if (d->m_runner) {
- d->m_runner->disconnect();
delete d->m_runner;
d->m_runner = 0;
}