diff options
| author | MarcoFalke <[email protected]> | 2019-02-04 14:26:02 -0500 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2019-02-04 14:26:07 -0500 |
| commit | 452acee4da206eb8792505914fd92245246b2290 (patch) | |
| tree | ff6ee5e55cc96bd3f7b20a2669d547e4657920ca /src/httpserver.cpp | |
| parent | Merge #15345: net: Correct comparison of addr count (diff) | |
| parent | log: Construct global logger on first use (diff) | |
| download | discoin-452acee4da206eb8792505914fd92245246b2290.tar.xz discoin-452acee4da206eb8792505914fd92245246b2290.zip | |
Merge #15266: memory: Construct globals on first use
77777c5624 log: Construct global logger on first use (MarcoFalke)
Pull request description:
The (de)initialization order is not well defined in C++, so generally it is not safe to use globals as the (de/con)structor of one global could use the (de/con)structor of another global before/after it has been (con/de)structed.
Specifically this fixes:
* `g_logger` might not be initialized on the first use, so do that. (Fixes #15111)
Tree-SHA512: eb9c22f4baf31ebc5b0b9ee6a51d1354bae1f0df186cc0ce818b4483c7b5a7f90268d2b549ee96b4c57f8ef36ab239dc6497f74f3e2ef166038f7437c368297d
Diffstat (limited to 'src/httpserver.cpp')
| -rw-r--r-- | src/httpserver.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp index ca60ea43a..b9ca037c9 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -364,8 +364,8 @@ bool InitHTTPServer() // Update libevent's log handling. Returns false if our version of // libevent doesn't support debug logging, in which case we should // clear the BCLog::LIBEVENT flag. - if (!UpdateHTTPServerLogging(g_logger->WillLogCategory(BCLog::LIBEVENT))) { - g_logger->DisableCategory(BCLog::LIBEVENT); + if (!UpdateHTTPServerLogging(LogInstance().WillLogCategory(BCLog::LIBEVENT))) { + LogInstance().DisableCategory(BCLog::LIBEVENT); } #ifdef WIN32 |