From 8b2e02b71df6548ee5cb1e753deec63680b9145d Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sun, 7 Mar 2021 04:25:22 +0000 Subject: [PATCH] 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. --- include/osgDB/Registry | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/osgDB/Registry b/include/osgDB/Registry index 2829ca61d..2b317ea91 100644 --- a/include/osgDB/Registry +++ b/include/osgDB/Registry @@ -50,7 +50,8 @@ namespace osgDB { The RegisterReaderWriterProxy can be used to automatically register at runtime a reader/writer with the Registry. */ -class OSGDB_EXPORT Registry : public osg::Referenced +class OSGDB_EXPORT Registry : osg::depends_on, + public osg::Referenced { public: