Skip to content

Commit 0522818

Browse files
committed
Proper destruction of task
1 parent e7d0edf commit 0522818

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Processors/Sources/ShellCommandSource.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ namespace
266266
{
267267
for (auto && send_data_task : send_data_tasks)
268268
{
269-
send_data_threads.emplace_back([task = std::move(send_data_task), this]()
269+
send_data_threads.emplace_back([task = std::move(send_data_task), this]() mutable
270270
{
271271
try
272272
{
@@ -276,6 +276,10 @@ namespace
276276
{
277277
std::lock_guard lock(send_data_lock);
278278
exception_during_send_data = std::current_exception();
279+
280+
/// task should be reset inside catch block or else it breaks d'tor
281+
/// invariants such as in ~WriteBuffer.
282+
task = {};
279283
}
280284
});
281285
}

0 commit comments

Comments
 (0)