diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-05-02 11:04:37 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-05-02 09:19:55 +0000 |
commit | 3b344ef8c230932c95172848fa9dc6342513e7bc (patch) | |
tree | cc99e498b567cb81895dae105e15bf81c8607cbd | |
parent | 03385ef86ba3bf0df63a443aff4c2ca4ba5cd9e9 (diff) |
Fix potential crash on shutdown
If the timer elapses while the plugin is already destructed,
then it will crash without the explicit qobject target.
Change-Id: I5c96600faecbd8b68e0923655483c870a2f40855
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r-- | src/usagestatisticplugin.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/usagestatisticplugin.cpp b/src/usagestatisticplugin.cpp index bef5fd3..ca13b9d 100644 --- a/src/usagestatisticplugin.cpp +++ b/src/usagestatisticplugin.cpp @@ -224,7 +224,7 @@ void UsageStatisticPlugin::submitDataOnFirstStart() */ if (m_provider && runFirstTime(*m_provider) && !telemetryLevelNotSet(*m_provider)) - QTimer::singleShot(1000 * 60 * 10, [this](){ m_provider->submit(); }); + QTimer::singleShot(1000 * 60 * 10, this, [this](){ m_provider->submit(); }); } static ::Utils::InfoBarEntry makeInfoBarEntry() |