Hi, the questionable point here is that I am not sure we should call destructor code for PROCESS_DETACH too. We should always see in front a thread-detach, so this call seems to be pretty superflous (and might be even wrong).
If you want you can modify crt-code so that destructor are just called for detach-thread case. Regards, Kai 2013/12/17 Victor Bombi <son...@telefonica.net>: > extern "C" __declspec(dllexport) BOOL APIENTRY DllMain > > should be the declaration for DllMain for being called > but DLL_THREAD_DETACH and DLL_PROCESS_DETACH are not received until > ioThreadFunc exits, so I have made unload function to call destructor > manually. > The problem now is that destructor is called twice and in release mode there > is an exception > > ----- Original Message ----- > From: "Victor Bombi" <son...@telefonica.net> > To: <mingw-w64-public@lists.sourceforge.net> > Sent: Saturday, December 14, 2013 10:23 AM > Subject: Re: [Mingw-w64-public] hang on exit > > >> Another thing to try would be to define DllMain but it seems not to be >> called. Why? >> >> >>> FreeLibrary does call destructor in this case. (outputs "1 is joinable") >>> there are several things to try: >>> >>> -dont call new to initialize >>> -dont call FreeLibrary to unload >>> (4 different cases) >>> >>> in some cases the hang seems to be on thread:join in others in >>> ioThreadFunc >>> >>> victor >> >> >> ------------------------------------------------------------------------------ >> Rapidly troubleshoot problems before they affect your business. Most IT >> organizations don't have a clear picture of how application performance >> affects their revenue. With AppDynamics, you get 100% visibility into your >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics >> Pro! >> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk >> _______________________________________________ >> Mingw-w64-public mailing list >> Mingw-w64-public@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public > > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Mingw-w64-public mailing list > Mingw-w64-public@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public