aboutsummaryrefslogtreecommitdiff
path: root/src/core/mainloop/mainloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/mainloop/mainloop.c')
-rw-r--r--src/core/mainloop/mainloop.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c
index e8de578b67..a42a8acc80 100644
--- a/src/core/mainloop/mainloop.c
+++ b/src/core/mainloop/mainloop.c
@@ -772,6 +772,10 @@ tor_shutdown_event_loop_and_exit(int exitcode)
main_loop_should_exit = 1;
main_loop_exit_value = exitcode;
+ if (! tor_libevent_is_initialized()) {
+ return; /* No event loop to shut down. */
+ }
+
/* Die with an assertion failure in ten seconds, if for some reason we don't
* exit normally. */
/* XXXX We should consider this code if it's never used. */