diff --git a/src/event/Loop.cxx b/src/event/Loop.cxx
index 6281b09ec..6e18b6bf8 100644
--- a/src/event/Loop.cxx
+++ b/src/event/Loop.cxx
@@ -42,6 +42,10 @@ EventLoop::~EventLoop()
 {
 	assert(idle.empty());
 	assert(timers.empty());
+
+	/* this is necessary to get a well-defined destruction
+	   order */
+	SocketMonitor::Cancel();
 }
 
 void