BewareMyPower commented on code in PR #377:
URL: https://github.com/apache/pulsar-client-cpp/pull/377#discussion_r1436329052


##########
lib/LogUtils.cc:
##########
@@ -25,6 +25,7 @@
 
 namespace pulsar {
 
+static std::atomic<LoggerFactory*> s_defaultLoggerFactory(new 
ConsoleLoggerFactory());

Review Comment:
   The `s_defaultLoggerFactory` is never released. It's not an issue if the 
application only run once, but if this library is dynamically loaded by an 
external system, it will be a memory leak.
   
   Could a static logger factory be used instead?
   
   ```c++
   static ConsoleLoggerFactory s_defaultLoggerFactory;
   ```
   
   Then return `&s_defaultLoggerFactory` in `getLoggerFactory()`.



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