mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-21 09:39:56 +00:00
FIx static destruction order chaos
This commit is contained in:
parent
2bc091fc05
commit
dec8d32b3a
@ -13,12 +13,23 @@ namespace SceneUtil
|
||||
public:
|
||||
static GLExtensionsObserver sInstance;
|
||||
|
||||
~GLExtensionsObserver() override
|
||||
{
|
||||
for (auto& ptr : sGLExtensions)
|
||||
{
|
||||
osg::ref_ptr<osg::GLExtensions> ref;
|
||||
if (ptr.lock(ref))
|
||||
ref->removeObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
void objectDeleted(void* referenced) override
|
||||
{
|
||||
sGLExtensions.erase(static_cast<osg::GLExtensions*>(referenced));
|
||||
}
|
||||
};
|
||||
|
||||
// construct after sGLExtensions so this gets destroyed first.
|
||||
GLExtensionsObserver GLExtensionsObserver::sInstance{};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user