I would have expected m_subscriptions to have been cleaned up by the time I get the closed_future.
Not sure if this could be a more serious issue (can the session be reopened and have old sessions? could it be considered a memory leak?). But for me it's an issue because my on_event_fn (indirectly) contains a reference to my wamp_session shared_ptr. So if I don't make sure to UNSUBSCRIBE all the subscriptions before closing the wamp_session the std::shared_ptr<wamp_session> reference counter never reaches zero and wamp_session is never destroyed.
Edit: Actually AFAICS the subscription in only removed from m_subscriptions in process_inbound_unsubscribed(). So I depend on my peer behaving and sending me the reply. If the connection dies for some reason and I can't get the UNSUBSCRIBED message back I'm out of luck.
I would have expected m_subscriptions to have been cleaned up by the time I get the closed_future.
Not sure if this could be a more serious issue (can the session be reopened and have old sessions? could it be considered a memory leak?). But for me it's an issue because my
on_event_fn(indirectly) contains a reference to my wamp_session shared_ptr. So if I don't make sure to UNSUBSCRIBE all the subscriptions before closing the wamp_session the std::shared_ptr<wamp_session> reference counter never reaches zero and wamp_session is never destroyed.Edit: Actually AFAICS the subscription in only removed from m_subscriptions in process_inbound_unsubscribed(). So I depend on my peer behaving and sending me the reply. If the connection dies for some reason and I can't get the UNSUBSCRIBED message back I'm out of luck.