diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp index 536518ed91..476b39414a 100644 --- a/websocketpp/transport/asio/endpoint.hpp +++ b/websocketpp/transport/asio/endpoint.hpp @@ -83,7 +83,7 @@ public: ~endpoint() { // clean up our io_service if we were initialized with an internal one. - if (m_state != UNINITIALIZED && m_external_io_service) { + if (m_state != UNINITIALIZED && !m_external_io_service) { delete m_io_service; } }