• Adam Simpkins's avatar
    logging: fix a crash when using logging after main() returns · 4a2619fe
    Adam Simpkins authored
    Summary:
    Fix a problem where `LoggerDB::get()` could crash when called after `main()`
    has returned.
    
    The `LoggerDBSingleton` object may have been destroyed already, so calling
    `LoggerDBSingleton::getDB()` was not allowed.  This updates the code to just
    store the singleton in a simple raw pointer, and only use the singleton helper
    object for flushing log handlers.
    
    Reviewed By: dmaone
    
    Differential Revision: D13984692
    
    fbshipit-source-id: a0c8550af367458ca39fefa9090e3165ad6a82bb
    4a2619fe
helpers.h 1.11 KB