GeneralInitOperation: guard against duplicate calls
This commit is contained in:
parent
e5aee5adf6
commit
8b036f9353
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue