From b2711b98bdc0dc220500a4b3ca94dfb97c4d17f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Barbosa?= Date: Wed, 17 Jul 2019 15:27:44 +0100 Subject: fix: tor: Call event_base_loopbreak from the event's callback Github-Pull: #16405 Rebased-From: a981e749e6553487cd48eda28e590f769e81c85c --- src/torcontrol.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp index 550e23b222..b56be26897 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); } } -- cgit v1.2.3