diff --git a/beast/module/asio/AsyncObject.h b/beast/module/asio/AsyncObject.h index 38d8e15fc..07c7fe4e4 100644 --- a/beast/module/asio/AsyncObject.h +++ b/beast/module/asio/AsyncObject.h @@ -83,8 +83,8 @@ public: void removeReference () { - if (--m_pending) - (static_cast (this))->asyncHandlersComplete (); + if (--m_pending == 0) + (static_cast(this))->asyncHandlersComplete(); } private: