Boost logo

Boost Users :

Subject: Re: [Boost-users] ASIO cancel question
From: Igor R (boost.lists_at_[hidden])
Date: 2009-08-06 11:22:31


> Accessing of the member variables will then cause a crash of the program. Any ideas on how to get around this problem of
the object destructing but the handler function already called by the
IO service thread?

You can find the solution the ASIO examples and tutorial: usually it's
worth binding the handers to the shared_ptr of the object, so that the
object's life time would be managed automatically, and no destruction
would occur before all the handlers are done.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net