I am experiencing a crash while using the Boost.Spirit and Boost.Thread libraries in my application. This only happens if I have used the Spirit parser during the lifetime of the process from the main thread.
The crash happens at exit and appears to be related to the clean-up of thread specific storage allocated by the Spirit parser. It is probably crashing due to the sequence of which DLLs are unloaded, as the thread specific memory is allocated inside a DLL that has already been unloaded. The Boost.Thread DLL is however not unloaded untill the application itself exits.
Is there a way for me to force Spirit to clean out its thread specific storage, e.g. in my dll-main when i get a process-detach notification?
Any solutions/hints would be appreciated.
PS! My platform and settings:
- Visual Studio 2005
- BOOST_ALL_DYN_LINK
- BOOST_SPIRIT_THREADSAFE