kenba/via-httplib

Example Client crashes

Closed this issue · 4 comments

Platform: windows 10 64-bit
The example client crashes during shutdown because the mutex associated withh http_client is closed earlier when the service goes out of scope. The http_client, declared global, destructs after io_service is destructed.
I'll submit a pull request. Hopefully I fixed the problem correctly.

A much simpler solution would be to just http_client=nullptr; just after io_service::run

kenba commented

Thank you Joseph.

I've incorporated a slightly different version of your simple solution, i.e. adding http_client.reset(); just after io_service::run since http_client is a std::shared_ptr.

Thanks. Either solution is fine by me.

On Sat, Jul 9, 2016 at 4:09 AM, Ken Barker notifications@github.com wrote:

Thank you Joseph.

I've incorporated a slightly different version of your simple solution,
i.e. adding http_client.reset(); just after io_service::run since
http_client is a std::shared_ptr.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#5 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AATYM43k3VQ0m6TtwBLOEV9lkSyKErYyks5qTpJCgaJpZM4JHmtq
.

Joseph Chakravarti Mariadassou
http://thesundayprogrammer.com

kenba commented

Closed as resolved.