diff --git a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/abstractworker.cpp b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/abstractworker.cpp index f18be83e32..09c6f5a076 100644 --- a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/abstractworker.cpp +++ b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/abstractworker.cpp @@ -121,7 +121,7 @@ void AbstractWorker::pause() return; if (speedtimer) { elapsed += speedtimer->elapsed(); - delete speedtimer; + speedtimerList.append(speedtimer); speedtimer = nullptr; JobInfoPointer info(new QMap); info->insert(AbstractJobHandler::NotifyInfoKey::kJobtypeKey, QVariant::fromValue(jobType)); @@ -678,6 +678,8 @@ AbstractWorker::~AbstractWorker() delete speedtimer; speedtimer = nullptr; } + + qDeleteAll(speedtimerList); } /*! diff --git a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/abstractworker.h b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/abstractworker.h index 6571a72009..fe7799150c 100644 --- a/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/abstractworker.h +++ b/src/plugins/common/core/dfmplugin-fileoperations/fileoperations/fileoperationutils/abstractworker.h @@ -198,6 +198,7 @@ protected slots: std::atomic_int64_t elapsed { 0 }; std::atomic_int64_t deleteFirstFileSize{ false }; bool isCutMerge{false}; + QList speedtimerList; }; DPFILEOPERATIONS_END_NAMESPACE