aboutsummaryrefslogtreecommitdiff
path: root/src/httpserver.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <[email protected]>2017-08-08 13:30:04 +0100
committerJoão Barbosa <[email protected]>2017-08-12 04:42:00 +0100
commit793667af1c31835e0eefcdd283930bb89cfeda8f (patch)
tree03a4e32c8830f582e75f9a35b3329df93c38679d /src/httpserver.cpp
parentMerge #10995: Fix resendwallettransactions assert failure if -walletbroadcast=0 (diff)
downloaddiscoin-793667af1c31835e0eefcdd283930bb89cfeda8f.tar.xz
discoin-793667af1c31835e0eefcdd283930bb89cfeda8f.zip
Improve shutdown process
Diffstat (limited to 'src/httpserver.cpp')
-rw-r--r--src/httpserver.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index ba0125540..adb64a65d 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -481,6 +481,8 @@ void StopHTTPServer()
}
if (eventBase) {
LogPrint(BCLog::HTTP, "Waiting for HTTP event thread to exit\n");
+ // Exit the event loop as soon as there are no active events.
+ event_base_loopexit(eventBase, nullptr);
// Give event loop a few seconds to exit (to send back last RPC responses), then break it
// Before this was solved with event_base_loopexit, but that didn't work as expected in
// at least libevent 2.0.21 and always introduced a delay. In libevent