From 31786fdaa1d428ab8edc2576c0067b0f181b05c5 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 17 Feb 2015 13:21:43 +0100 Subject: [PATCH] Fix crash in SocketEvents::ChangeEvents refs #6109 --- lib/base/socketevents.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/base/socketevents.cpp b/lib/base/socketevents.cpp index 81f463120..a74d16aef 100644 --- a/lib/base/socketevents.cpp +++ b/lib/base/socketevents.cpp @@ -195,7 +195,8 @@ void SocketEvents::Unregister(void) void SocketEvents::ChangeEvents(int events) { - ASSERT(m_FD != INVALID_SOCKET); + if (m_FD == INVALID_SOCKET) + BOOST_THROW_EXCEPTION(std::runtime_error("Tried to read/write from a closed socket.")); { boost::mutex::scoped_lock lock(l_SocketIOMutex); -- 2.40.0