Skip to content

Commit da7a6ca

Browse files
committed
Ensure global Mutex is initialized before Registry
A Registry instance may be accessed before the global mutex, e.g. here: https://github.com/openscenegraph/OpenSceneGraph/blob/e77f50371ce6ab05ee0c523fc7a4604ad639e047/src/osgText/Font.cpp#L49 This leads to the Mutex being destroyed before the Registry is destroyed. This causes a crash at exit, as described in #1048. Fixes #1048.
1 parent e77f503 commit da7a6ca

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

include/osgDB/Registry

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ namespace osgDB {
5050
The RegisterReaderWriterProxy can be used to automatically
5151
register at runtime a reader/writer with the Registry.
5252
*/
53-
class OSGDB_EXPORT Registry : public osg::Referenced
53+
class OSGDB_EXPORT Registry : osg::depends_on<OpenThreads::Mutex*, osg::Referenced::getGlobalReferencedMutex>,
54+
public osg::Referenced
5455
{
5556
public:
5657

0 commit comments

Comments
 (0)