From ae58a7f457c2b1624ddf3e517c5543cab026a0e5 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 18 Oct 2016 07:22:01 -0400 Subject: [PATCH] Engaged invokable is destructible: fix #147 --- CHANGELOG.md | 1 + include/beast/websocket/detail/invokable.hpp | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f81b9769..05cf22c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Add basic_parser_v1::reset * Fix handling of body_what::pause in basic_parser_v1 * Add headers_parser +* Engaged invokable is destructible API Changes: diff --git a/include/beast/websocket/detail/invokable.hpp b/include/beast/websocket/detail/invokable.hpp index 596b44e4..fb19d0c9 100644 --- a/include/beast/websocket/detail/invokable.hpp +++ b/include/beast/websocket/detail/invokable.hpp @@ -74,15 +74,11 @@ class invokable alignas(holder) buf_type buf_; public: -#ifndef NDEBUG ~invokable() { - // Engaged invokables must be invoked before - // destruction otherwise the io_service - // invariants are broken w.r.t completions. - BOOST_ASSERT(! base_); + if(base_) + base_->~base(); } -#endif invokable() = default;