From 4b99b36eda12924848ab336a75739017a36a60f5 Mon Sep 17 00:00:00 2001 From: Dimitris Christodoulou Date: Fri, 4 Oct 2024 19:20:55 +0100 Subject: [PATCH] Columnar query: Clear callback when failing to create pending_op --- core/columnar/query_component.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/columnar/query_component.cxx b/core/columnar/query_component.cxx index 8c0f3ef71..9360a47ad 100644 --- a/core/columnar/query_component.cxx +++ b/core/columnar/query_component.cxx @@ -77,6 +77,12 @@ class pending_query_operation } } + auto clear_callback() + { + const std::scoped_lock lock{ callback_mutex_ }; + callback_ = nullptr; + } + auto dispatch() -> error { auto op = http_.do_http_request( @@ -156,7 +162,9 @@ class pending_query_operation #else return_error.ec = op.error(); #endif - invoke_callback({}, return_error); + + clear_callback(); + return return_error; }