18 Feb
2009
18 Feb
'09
8:54 a.m.
I've attached a zip of the Visual Studio 2008 solution and project files that reproduces the issue. The bin folder contains the compiled executable as well, if for some reason this is useful.
I built and run your code. It really crashes if you forcibly unload the dll but it does *not* crash if I comment-out this line *or* if I remove acceptor object from the dll code. It seems that the reason of the crash is that a dll statically linked to CRT has its own private CRT (including memmoty management), so when you free the dll, all the asio objects created from within the dll (asio services in this case) become inaccessible. Try and build asio, dll and the host app with dynamic CRT - probably this will help.