diff options
author | Friedemann Kleint <[email protected]> | 2011-07-18 16:10:25 +0200 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2011-07-18 17:39:35 +0200 |
commit | 4f741fc7c8b2930742f0c660790121f698d9266b (patch) | |
tree | 4f4d248870d67a45ee29893c262ce9b32713a15b /src/plugins/valgrind/callgrindtool.cpp | |
parent | 22c0f6ae0dd7baf7c7a9cc39011c9e3210e34fb5 (diff) |
Analyzer[callgrind]: Fix a crash when remote profiling.
Task-number: QTCREATORBUG-5402
Change-Id: Ifd42befddccd28abdc5ee0a701321e1a6cf58f7f
Reviewed-on: http://codereview.qt.nokia.com/1774
Reviewed-by: Qt Sanity Bot <[email protected]>
Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src/plugins/valgrind/callgrindtool.cpp')
-rw-r--r-- | src/plugins/valgrind/callgrindtool.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index d823560246a..ea455f90ae9 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -121,7 +121,7 @@ public: void updateEventCombo(); IAnalyzerEngine *createEngine(const AnalyzerStartParameters &sp, - ProjectExplorer::RunConfiguration *runConfiguration); + ProjectExplorer::RunConfiguration *runConfiguration = 0); signals: void cycleDetectionEnabled(bool enabled); @@ -596,16 +596,18 @@ IAnalyzerEngine *CallgrindToolPrivate::createEngine(const AnalyzerStartParameter AnalyzerManager::showStatusMessage(AnalyzerManager::msgToolStarted(q->displayName())); - // apply project settings - AnalyzerProjectSettings *analyzerSettings = runConfiguration->extraAspect<AnalyzerProjectSettings>(); - ValgrindProjectSettings *settings = analyzerSettings->subConfig<ValgrindProjectSettings>(); - QTC_ASSERT(settings, return engine) - QTC_ASSERT(m_visualisation, return engine); - m_visualisation->setMinimumInclusiveCostRatio(settings->visualisationMinimumInclusiveCostRatio() / 100.0); - m_proxyModel->setMinimumInclusiveCostRatio(settings->minimumInclusiveCostRatio() / 100.0); - m_dataModel->setVerboseToolTipsEnabled(settings->enableEventToolTips()); + // apply project settings + if (runConfiguration) { + if (const AnalyzerProjectSettings *analyzerSettings = runConfiguration->extraAspect<AnalyzerProjectSettings>()) { + if (const ValgrindProjectSettings *settings = analyzerSettings->subConfig<ValgrindProjectSettings>()) { + m_visualisation->setMinimumInclusiveCostRatio(settings->visualisationMinimumInclusiveCostRatio() / 100.0); + m_proxyModel->setMinimumInclusiveCostRatio(settings->minimumInclusiveCostRatio() / 100.0); + m_dataModel->setVerboseToolTipsEnabled(settings->enableEventToolTips()); + } + } + } return engine; } |