
23 Apr
2013
23 Apr
'13
8:25 a.m.
Hi, I get a crash when trying to instantiate a boost::regex during program shutdown. I've boiled down the code to this: #include <boost/regex.hpp> #include <boost/thread.hpp> struct Object { ~Object() { boost::regex param("a"); } static Object& Instantiate() { static boost::thread_specific_ptr<Object> theObject; if (theObject.get() == 0) theObject.reset(new Object); return *theObject; } }; int main() { Object::Instantiate(); boost::regex param("a"); return 0; } Program exists fine if I comment out the boost::regex instantiation in main. I'm using Boost v. 1.42, Visual Studio 2008 Pro on Windows 7 SP1 64 bit. Test program is 64 bit too. TIA, Gianfranco