aboutsummaryrefslogtreecommitdiff
path: root/src/torcontrol.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-07-17 15:27:44 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-07-17 15:32:38 +0100
commita981e749e6553487cd48eda28e590f769e81c85c (patch)
treed08c59d88e1f8bb9088d9745cc174fe4199dc086 /src/torcontrol.cpp
parent459baa1756b7f2d10d261daa0d0f5f4b91cef21f (diff)
fix: tor: Call event_base_loopbreak from the event's callback
Diffstat (limited to 'src/torcontrol.cpp')
-rw-r--r--src/torcontrol.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp
index a1c730ba08..3f40785c21 100644
--- a/src/torcontrol.cpp
+++ b/src/torcontrol.cpp
@@ -759,7 +759,9 @@ void InterruptTorControl()
{
if (gBase) {
LogPrintf("tor: Thread interrupt\n");
- event_base_loopbreak(gBase);
+ event_base_once(gBase, -1, EV_TIMEOUT, [](evutil_socket_t, short, void*) {
+ event_base_loopbreak(gBase);
+ }, nullptr, nullptr);
}
}