rm5248 commented on PR #271:
URL: https://github.com/apache/logging-log4cxx/pull/271#issuecomment-1755541563

   To Stephen's point above: once you call `exit()` or if you return from 
main(which effectively calls `exit()` for you), then statically allocated 
memory will begin to be deallocated.  I'm not an expert on the C++ standard, 
but I think that any threads executing after you call `exit()` put you into the 
realm of undefined behavior.
   
   The only safe way to shut down is to make sure that all of your threads are 
stopped before your program exits.  If you don't, you will often get random 
crashes upon exit.


-- 
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: notifications-unsubscr...@logging.apache.org

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

Reply via email to