diff --git a/src/Core/BackgroundSchedulePool.h b/src/Core/BackgroundSchedulePool.h index 65e163a5320..8e9dc89abde 100644 --- a/src/Core/BackgroundSchedulePool.h +++ b/src/Core/BackgroundSchedulePool.h @@ -161,6 +161,8 @@ public: task_info->deactivate(); } + operator bool() const { return task_info != nullptr; } + BackgroundSchedulePoolTaskInfo * operator->() { return task_info.get(); } const BackgroundSchedulePoolTaskInfo * operator->() const { return task_info.get(); } diff --git a/src/Storages/StorageBuffer.cpp b/src/Storages/StorageBuffer.cpp index 6b51f64c25e..38468413e49 100644 --- a/src/Storages/StorageBuffer.cpp +++ b/src/Storages/StorageBuffer.cpp @@ -468,6 +468,9 @@ void StorageBuffer::startup() void StorageBuffer::shutdown() { + if (!flush_handle) + return; + flush_handle->deactivate(); try