diff options
Diffstat (limited to 'src/Main.cxx')
-rw-r--r-- | src/Main.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Main.cxx b/src/Main.cxx index 009ed9a00..8e7fc1236 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -59,6 +59,7 @@ #include "config/Option.hxx" #include "config/Domain.hxx" #include "util/RuntimeError.hxx" +#include "util/ScopeExit.hxx" #ifdef ENABLE_DAEMON #include "unix/Daemon.hxx" @@ -534,6 +535,8 @@ static inline #endif int mpd_main(int argc, char *argv[]) { + AtScopeExit() { log_deinit(); }; + try { return MainOrThrow(argc, argv); } catch (const std::exception &e) { @@ -717,8 +720,6 @@ try { IcuFinish(); - log_deinit(); - return EXIT_SUCCESS; } catch (const std::exception &e) { LogError(e); |