xiaokang commented on code in PR #20028:
URL: https://github.com/apache/doris/pull/20028#discussion_r1205462891


##########
be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:
##########
@@ -85,7 +85,26 @@ class InvertedIndexColumnWriterImpl : public 
InvertedIndexColumnWriter {
         _field_name = std::wstring(field_name.begin(), field_name.end());
     }
 
-    ~InvertedIndexColumnWriterImpl() override = default;
+    ~InvertedIndexColumnWriterImpl() override {
+        // The close function is expected to be called when the column writer 
finishes its operations.
+        // If it's not called, it indicates that an unexpected event has 
occurred.
+        // This destructor checks if the close() function has been called. If 
not, it attempts to release memory.
+        if (_index_writer) {
+            _CLDELETE(_index_writer)

Review Comment:
   add try cache to avoid core dump caused by exception



-- 
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]

Reply via email to