1
0
Fork 0

GeneralInitOperation: guard against duplicate calls

This commit is contained in:
James Turner 2022-09-05 12:53:40 +01:00
parent e5aee5adf6
commit 8b036f9353

View file

@ -175,7 +175,12 @@ struct GeneralInitOperation : public GraphicsContextOperation
bool guiInit()
{
static osg::ref_ptr<GeneralInitOperation> genOp;
static bool didInit = false;
if (didInit) {
return true;
}
if (!genOp.valid())
{
// Pick some window on which to do queries.
@ -210,6 +215,7 @@ bool guiInit()
initOp = 0;
#endif
genOp = 0;
didInit = true;
// we're done
return true;
}