3 Jan
2019
3 Jan
'19
7:25 p.m.
Suppose I have a session object A, the shared_ptr<A> is created and stored in a global connection list after a connection is accepted by async_accept, when the connection is terminated, the reference in connection list is removed, but since A has a member B still holds A reference, that session object is never deleted, is it memory leak? class A : public boost::enable_shared_from_this<A> { public: A(); ~A(); void Start() {b = make_shared<B>(shared_from_this());} void Stop(); private: shared_ptr<B> b; };