fgerlits commented on code in PR #2040:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2040#discussion_r2394340315


##########
libminifi/test/libtest/integration/ConnectionCountingServer.cpp:
##########
@@ -85,14 +85,13 @@ void ReverseBodyPostHandler::saveConnectionId(struct 
mg_connection* conn) {
 
 AddIdToUserConnectionData::AddIdToUserConnectionData() {
   init_connection = [](const struct mg_connection*, void** 
user_connection_data) -> int {
-    minifi::utils::SmallString<36>* id = new 
minifi::utils::SmallString<36>(minifi::utils::IdGenerator::getIdGenerator()->generate().to_string());
+    auto id = new 
minifi::utils::SmallString<36>(minifi::utils::IdGenerator::getIdGenerator()->generate().to_string());
     *user_connection_data = reinterpret_cast<void*>(id);
     return 0;
   };
 
   connection_close = [](const struct mg_connection* conn) -> void {
-    auto user_connection_data = 
reinterpret_cast<minifi::utils::SmallString<36>*>(mg_get_user_connection_data(conn));
-    delete user_connection_data;
+    std::ignore = 
std::unique_ptr<minifi::utils::SmallString<36>>(reinterpret_cast<minifi::utils::SmallString<36>*>(mg_get_user_connection_data(conn)));

Review Comment:
   it's a bit weird to create a `unique_ptr` only to destruct it immediately; I 
think keeping the `delete` with a NOLINT comment would be better



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

Reply via email to