回退 'Pull Request !46827 : [Bug]: eventHandler析构前销毁所有的任务'

This commit is contained in:
llzr 2024-11-04 07:06:39 +00:00 committed by Gitee
parent 5566db51d1
commit 7475006938
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 2 additions and 9 deletions

View File

@ -28,7 +28,7 @@ class TaskRunnerAdapter : public virtual AceType {
public:
TaskRunnerAdapter() = default;
~TaskRunnerAdapter() override = default;
virtual ~TaskRunnerAdapter() override = default;
virtual void PostTask(
std::function<void()> task, const std::string& name, PriorityType priorityType = PriorityType::LOW)

View File

@ -16,13 +16,6 @@
#include "core/common/task_runner_adapter_impl.h"
namespace OHOS::Ace {
TaskRunnerAdapterImpl::~TaskRunnerAdapterImpl()
{
if (eventHandler_) {
eventHandler_->RemoveAllEvents();
}
}
void TaskRunnerAdapterImpl::Initialize(bool useCurrentEventRunner, const std::string& name)
{
if (useCurrentEventRunner) {

View File

@ -27,7 +27,7 @@ class TaskRunnerAdapterImpl final : public TaskRunnerAdapter {
public:
TaskRunnerAdapterImpl():TaskRunnerAdapter() {};
~TaskRunnerAdapterImpl() override;
~TaskRunnerAdapterImpl() = default;
void PostTask(std::function<void()> task, const std::string& name, PriorityType priorityType = PriorityType::LOW) override;
void PostTaskForTime(std::function<void()> task, uint32_t targetTime, const std::string& caller) override;
void PostDelayedTask(