Hi,

My osgEarth based application was crashing from time to time (3-4 times a day). 
It was not easy to debug. But eventually I've caught the problem place in 
Release with Debug info mode.

DatabasePager thread crashed in osgText/Font.cpp file in the function:


Code:
osg::ref_ptr<Font>& Font::getDefaultFont()
{
    static OpenThreads::Mutex s_DefaultFontMutex;
    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_DefaultFontMutex);

    static osg::ref_ptr<Font> s_defaultFont = new DefaultFont;
    return s_defaultFont;
}



I suppose that scoped static variable initialization is not thread-safe.

Perhaps the s_DefaultFontMutex variable should be the global.

Regards,
Alexander

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63290#63290





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to