1
0
Fork 0

Trying to fix EnvironmentManager shutdown crash.

Not sure this will fix it, but it’s the only scenario I can spot so far,
so let’s try anwyay.

Reported at Sentry as: FLIGHTGEAR-8
This commit is contained in:
James Turner 2020-08-24 07:26:21 +01:00
parent 4fe8a118cc
commit 11932bac4e
2 changed files with 7 additions and 10 deletions

View file

@ -83,9 +83,6 @@ void FG3DCloudsListener::valueChanged( SGPropertyNode * node )
FGEnvironmentMgr::FGEnvironmentMgr () : FGEnvironmentMgr::FGEnvironmentMgr () :
_environment(new FGEnvironment()), _environment(new FGEnvironment()),
fgClouds(nullptr),
_cloudLayersDirty(true),
_3dCloudsEnableListener(nullptr),
_sky(globals->get_renderer()->getSky()) _sky(globals->get_renderer()->getSky())
{ {
fgClouds = new FGClouds; fgClouds = new FGClouds;
@ -154,7 +151,7 @@ FGEnvironmentMgr::shutdown()
{ {
globals->get_event_mgr()->removeTask("updateClosestAirport"); globals->get_event_mgr()->removeTask("updateClosestAirport");
delete _multiplayerListener; delete _multiplayerListener;
_multiplayerListener = NULL; _multiplayerListener = nullptr;
SGSubsystemGroup::shutdown(); SGSubsystemGroup::shutdown();
} }

View file

@ -92,13 +92,13 @@ private:
double get_cloud_layer_maxalpha (int index ) const; double get_cloud_layer_maxalpha (int index ) const;
void set_cloud_layer_maxalpha (int index, double maxalpha); void set_cloud_layer_maxalpha (int index, double maxalpha);
FGEnvironment * _environment; // always the same, for now FGEnvironment * _environment = nullptr; // always the same, for now
FGClouds *fgClouds; FGClouds *fgClouds = nullptr;
bool _cloudLayersDirty; bool _cloudLayersDirty = true;
simgear::TiedPropertyList _tiedProperties; simgear::TiedPropertyList _tiedProperties;
SGPropertyChangeListener * _3dCloudsEnableListener; SGPropertyChangeListener * _3dCloudsEnableListener = nullptr;
FGEnvironmentMgrMultiplayerListener * _multiplayerListener; FGEnvironmentMgrMultiplayerListener * _multiplayerListener = nullptr;
SGSky* _sky; SGSky* _sky = nullptr;
}; };
#endif // _ENVIRONMENT_MGR_HXX #endif // _ENVIRONMENT_MGR_HXX