Closed brunonery closed 12 years ago
This is a bug in the client code -- the client object can already be destroyed by the time the callback is invoked because the client instance is in the body of the timer callback.
Not a problem with client code.
I'm experiencing the same problem, though I'm compiling with gcc 4.2 on macosx. I've been able to fix the problem by hacking the 0.9.4 code. Specifically, there are two async_client constructors in async_impl.hpp. The problem appears to be that the constructor that accepts an io_service doesn't initialize the resolverstrand data member. Adding the following line to the body of that constructor fixed the problem for me...
connection_base::resolver_strand_.reset(new
boost::asio::io_service::strand(service_));
Hope this helps,
Oh, okay. Can you submit a pull request to fix this? It might make sense to have a 0.9.5 to address these issues. I can start a branch if you're up for this.
On Tue, Oct 23, 2012 at 11:22 AM, neobobkrause notifications@github.comwrote:
Not a problem with client code.
I'm experiencing the same problem, though I'm compiling with gcc 4.2 on macosx. I've been able to fix the problem by hacking the 0.9.4 code. Specifically, there are two async_client constructors in async_impl.hpp. The problem appears to be that the constructor that accepts an io_service doesn't initialize the resolverstrand data member. Adding the following line to the body of that constructor fixed the problem for me...
connection_base::resolver_strand_.reset(new boost::asio::io_service::strand(service_));
Hope this helps,
Bob
— Reply to this email directly or view it on GitHubhttps://github.com/cpp-netlib/cpp-netlib/issues/122#issuecomment-9685838.
Dean Michael Berris | Software Engineer Google
Sure. What's the tag?
The branch is 0.9-devel on cpp-netlib/cpp-netlib. If you can send a pull request against that branch we can start the process of getting it released as 0.9.5.
On Tue, Oct 23, 2012 at 3:53 PM, neobobkrause notifications@github.comwrote:
Sure. What's the tag?
— Reply to this email directly or view it on GitHubhttps://github.com/cpp-netlib/cpp-netlib/issues/122#issuecomment-9690598.
Dean Michael Berris | Software Engineer Google
The following program:
gives the following error when run:
The backtrace from GDB is: