forked from qt-creator/qt-creator
CtfVisualizer: Destroy CtfTool earlier again
Amends 796053d7.
After all, the defaulted destructor of the class did some actual work
via the destructors of the QScopedPointer members.
Change-Id: If6dc8a3d57961ec263fced11f9fa9f7e9f8c54cc
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -14,7 +14,7 @@ class CtfVisualizerPlugin : public ExtensionSystem::IPlugin
|
||||
|
||||
void initialize() final
|
||||
{
|
||||
setupCtfVisualizerTool();
|
||||
setupCtfVisualizerTool(this);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -35,8 +35,9 @@ namespace CtfVisualizer::Internal {
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
CtfVisualizerTool::CtfVisualizerTool()
|
||||
: m_modelAggregator(new Timeline::TimelineModelAggregator(this))
|
||||
CtfVisualizerTool::CtfVisualizerTool(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_modelAggregator(new Timeline::TimelineModelAggregator(this))
|
||||
, m_zoomControl(new Timeline::TimelineZoomControl(this))
|
||||
, m_statisticsModel(new CtfStatisticsModel(this))
|
||||
, m_traceManager(new CtfTraceManager(this, m_modelAggregator.get(), m_statisticsModel.get()))
|
||||
@@ -251,9 +252,9 @@ void CtfVisualizerTool::loadJson(const QString &fileName)
|
||||
m_loader->start();
|
||||
}
|
||||
|
||||
void setupCtfVisualizerTool()
|
||||
void setupCtfVisualizerTool(QObject *guard)
|
||||
{
|
||||
static CtfVisualizerTool theCtfVisualizerTool;
|
||||
(void) new CtfVisualizerTool(guard);
|
||||
}
|
||||
|
||||
} // namespace CtfVisualizer::Internal
|
||||
|
||||
@@ -28,7 +28,7 @@ class CtfVisualizerTool : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CtfVisualizerTool();
|
||||
explicit CtfVisualizerTool(QObject *parent);
|
||||
~CtfVisualizerTool();
|
||||
|
||||
Timeline::TimelineModelAggregator *modelAggregator() const;
|
||||
@@ -66,6 +66,6 @@ private:
|
||||
QMenu *const m_restrictToThreadsMenu;
|
||||
};
|
||||
|
||||
void setupCtfVisualizerTool();
|
||||
void setupCtfVisualizerTool(QObject *guard);
|
||||
|
||||
} // namespace CtfVisualizer::Internal
|
||||
|
||||
Reference in New Issue
Block a user