Commit 5b88ca28 authored by Andrew Mitchell's avatar Andrew Mitchell
Browse files

Reset pointers before logging is shutdown to prevent destructors logging to unitialized logger

parent 8ebe2a6f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -41,6 +41,11 @@ int main(int argc, char** argv) {

    int ret = example_main(nonblocking_connection, blocking_connection, argc, argv);

    // Manually reset connections before shutting down logging to avoid logging to
    // an uninitialized logger from a destructor
    nonblocking_connection.reset();
    blocking_connection.reset();

    google::protobuf::ShutdownProtobufLibrary();
    google::ShutdownGoogleLogging();
    google::ShutDownCommandLineFlags();