regex instantiation crashes at program exit

Hi,
I get a crash when trying to instantiate a boost::regex during program shutdown. I've boiled down the code to this:
#include

I get a crash when trying to instantiate a boost::regex during program shutdown. I've boiled down the code to this:
This is your standard order-of-destruction problem: some of regexes internal data structions have already been destroyed when you come to instantiate the regex. You can fix this by linking to the dll version of boost.regex (define BOOST_REGEX_DYN_LIB when building your app). It also works for me if I add a global instance of boost::regex, but I'm not sure if that's actually guaranteed to work... HTH, John.
participants (2)
-
Gianfranco Zuliani
-
John Maddock