This is not thread safe - by C++11 standard it should be, but even in VS2012 static variable initialization is not yet thread safe.