Copilot commented on code in PR #50572:
URL: https://github.com/apache/doris/pull/50572#discussion_r2074842946


##########
be/src/http/web_page_handler.cpp:
##########
@@ -59,10 +58,12 @@ WebPageHandler::WebPageHandler(EvHttpServer* server, 
ExecEnv* exec_env)
 }
 
 WebPageHandler::~WebPageHandler() {
-    STLDeleteValues(&_page_map);
+    for (auto& handler : _page_map) {
+        delete handler.second;
+    }

Review Comment:
   [nitpick] Consider replacing the manual deletion loop with smart pointers 
(e.g., unique_ptr) for managing _page_map entries to improve exception safety 
and reduce manual memory management.
   ```suggestion
       // No manual deletion needed; std::unique_ptr will handle cleanup.
   ```



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to