yiguolei commented on code in PR #32039:
URL: https://github.com/apache/doris/pull/32039#discussion_r1527670203
##########
be/src/vec/exec/scan/scanner_context.h:
##########
@@ -100,7 +108,15 @@ class ScannerContext : public
std::enable_shared_from_this<ScannerContext>,
int64_t max_bytes_in_blocks_queue, const int
num_parallel_instances = 1,
pipeline::ScanLocalStateBase* local_state = nullptr);
- virtual ~ScannerContext() = default;
+ ~ScannerContext() override {
+
SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(_query_thread_context.query_mem_tracker);
+ _blocks_queue.clear();
+ vectorized::BlockUPtr block;
+ while (_free_blocks.try_dequeue(block)) {
+ // do nothing
+ }
+ block.release();
Review Comment:
refer https://en.cppreference.com/w/cpp/memory/unique_ptr/release
release method will not deconstruct the object, there is memory leak.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]