diff --git a/core/stream.hh b/core/stream.hh index 9376c0f378..c6d385a5a5 100644 --- a/core/stream.hh +++ b/core/stream.hh @@ -41,6 +41,7 @@ public: stream() = default; stream(const stream&) = delete; stream(stream&&) = delete; + ~stream(); void operator=(const stream&) = delete; void operator=(stream&&) = delete; @@ -93,6 +94,15 @@ public: friend class stream; }; + +template +inline +stream::~stream() { + if (_sub) { + _sub->_stream = nullptr; + } +} + template inline subscription