Fix a couple of potential crashes on exit.
- Font cache shutdown explicitly - Pending GUI snapshot cleared explicitly Both of these are dependencies on the osgViewer / GLContext.
This commit is contained in:
parent
4fb5bc8512
commit
85f75dee4f
5 changed files with 22 additions and 0 deletions
|
@ -85,6 +85,11 @@ FGFontCache* FGFontCache::instance()
|
||||||
return global_fontCacheInstance.get();
|
return global_fontCacheInstance.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FGFontCache::shutdown()
|
||||||
|
{
|
||||||
|
global_fontCacheInstance.reset();
|
||||||
|
}
|
||||||
|
|
||||||
FGFontCache::FGFontCache() :
|
FGFontCache::FGFontCache() :
|
||||||
_initialized(false)
|
_initialized(false)
|
||||||
{
|
{
|
||||||
|
|
|
@ -78,6 +78,7 @@ private:
|
||||||
public:
|
public:
|
||||||
// note this accesor is NOT thread-safe
|
// note this accesor is NOT thread-safe
|
||||||
static FGFontCache* instance();
|
static FGFontCache* instance();
|
||||||
|
static void shutdown();
|
||||||
|
|
||||||
~FGFontCache();
|
~FGFontCache();
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,8 @@ extern void guiErrorMessage(const char *txt);
|
||||||
extern void guiErrorMessage(const char *txt, const sg_throwable &throwable);
|
extern void guiErrorMessage(const char *txt, const sg_throwable &throwable);
|
||||||
|
|
||||||
extern bool fgDumpSnapShot();
|
extern bool fgDumpSnapShot();
|
||||||
|
void fgCancelSnapShot();
|
||||||
|
|
||||||
extern void fgDumpSceneGraph();
|
extern void fgDumpSceneGraph();
|
||||||
extern void fgDumpTerrainBranch();
|
extern void fgDumpTerrainBranch();
|
||||||
extern void fgPrintVisibleSceneInfoCommand();
|
extern void fgPrintVisibleSceneInfoCommand();
|
||||||
|
|
|
@ -483,6 +483,11 @@ namespace
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void cancel()
|
||||||
|
{
|
||||||
|
_snapShotOp = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// constructor to be executed in main loop's thread
|
// constructor to be executed in main loop's thread
|
||||||
GUISnapShotOperation() :
|
GUISnapShotOperation() :
|
||||||
|
@ -567,6 +572,11 @@ bool fgDumpSnapShot ()
|
||||||
return GUISnapShotOperation::start();
|
return GUISnapShotOperation::start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fgCancelSnapShot()
|
||||||
|
{
|
||||||
|
GUISnapShotOperation::cancel();
|
||||||
|
}
|
||||||
|
|
||||||
// do an entire scenegraph dump
|
// do an entire scenegraph dump
|
||||||
void fgDumpSceneGraph()
|
void fgDumpSceneGraph()
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
#include <Navaids/navlist.hxx>
|
#include <Navaids/navlist.hxx>
|
||||||
#include <Viewer/renderer.hxx>
|
#include <Viewer/renderer.hxx>
|
||||||
#include <Viewer/viewmgr.hxx>
|
#include <Viewer/viewmgr.hxx>
|
||||||
|
#include <GUI/FGFontCache.hxx>
|
||||||
|
|
||||||
#include "globals.hxx"
|
#include "globals.hxx"
|
||||||
#include "locale.hxx"
|
#include "locale.hxx"
|
||||||
|
@ -223,6 +224,9 @@ FGGlobals::~FGGlobals()
|
||||||
// renderer touches subsystems during its destruction
|
// renderer touches subsystems during its destruction
|
||||||
set_renderer(NULL);
|
set_renderer(NULL);
|
||||||
|
|
||||||
|
FGFontCache::shutdown();
|
||||||
|
fgCancelSnapShot();
|
||||||
|
|
||||||
delete subsystem_mgr;
|
delete subsystem_mgr;
|
||||||
subsystem_mgr = NULL; // important so ::get_subsystem returns NULL
|
subsystem_mgr = NULL; // important so ::get_subsystem returns NULL
|
||||||
vw = 0; // don't delete the viewer until now
|
vw = 0; // don't delete the viewer until now
|
||||||
|
|
Loading…
Add table
Reference in a new issue