abumq / easyloggingpp

C++ logging library. It is extremely powerful, extendable, light-weight, fast performing, thread and type safe and consists of many built-in features. It provides ability to write logs in your own customized format. It also provide support for logging your classes, third-party libraries, STL and third-party containers etc.
MIT License
3.75k stars 918 forks source link

Writer Destructor Not Clearing #850

Open pjy03 opened 6 months ago

pjy03 commented 6 months ago

I am using the library in an environment of an DLL. I have a function that helps me to configure the loggers during DLL_PROCESS_ATTACH. And also an extra function to configure the logger when the upper layer of the system pass in some arguments. The system works fine when the upper layer calls the extra function. However, when the upper layer did not call that upper function something will happen.

The memory of the system will pile up. The call stack will be full of the ~Writer() destructor which appears to have run to its last line (DefaultLogDispatchCallback->dispatch() Note : I did not use dispatch) for destruction but wont get rid of it at all. This also results in my log file having tons of my first log message . In what scenarios, does this happen ?