summaryrefslogtreecommitdiffstats
path: root/src/plugins/tracing/qctfplugin.cpp
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2023-03-20 08:17:52 +0200
committerJanne Koskinen <janne.p.koskinen@qt.io>2023-04-26 10:46:06 +0000
commitbb8aada627e23a7f7e23dfdb97d443f1b847086a (patch)
tree24f21a652528e03e6bbc20a44bba5e3ba3c634e1 /src/plugins/tracing/qctfplugin.cpp
parent257b3161c5c5e46cd040371da77cb6a06987cf50 (diff)
Fix crash at exit when tracing
The crash is caused by the cleanup sending trace messages when the plugin has already been destroyed. Add shutdown callback to the plugin to indicate this has happened. We can't use signals since that also generetes trace event. Pick-to: 6.5 Change-Id: I2e490fc51c2aaa97c240c1496a528a6ff6077bd0 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Diffstat (limited to 'src/plugins/tracing/qctfplugin.cpp')
-rw-r--r--src/plugins/tracing/qctfplugin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/tracing/qctfplugin.cpp b/src/plugins/tracing/qctfplugin.cpp
index 8f2245bb286..daa2b3637e1 100644
--- a/src/plugins/tracing/qctfplugin.cpp
+++ b/src/plugins/tracing/qctfplugin.cpp
@@ -22,9 +22,13 @@ public:
~QCtfTracePlugin()
{
m_cleanup = true;
+ *m_shutdown = true;
QCtfLibImpl::cleanup();
}
-
+ void shutdown(bool *shutdown) override
+ {
+ m_shutdown = shutdown;
+ }
bool tracepointEnabled(const QCtfTracePointEvent &point) override
{
if (m_cleanup)
@@ -51,6 +55,7 @@ public:
}
private:
bool m_cleanup = false;
+ bool *m_shutdown = nullptr;
};
#include "qctfplugin.moc"