--- SimGear-0.3.10/simgear/scene/sky/sky.cxx~ 2007-03-30 12:08:35.000000000 +0200
+++ SimGear-0.3.10/simgear/scene/sky/sky.cxx 2007-03-30 12:08:36.000000000 +0200
@@ -33,6 +33,8 @@
#include "sky.hxx"
#include "cloudfield.hxx"
+SGSky *thesky = NULL;
+
// Constructor
SGSky::SGSky( void ) {
effective_visibility = visibility = 10000.0;
@@ -47,6 +49,9 @@
// ramp_down = 4.0;
in_cloud = -1;
+
+ if (thesky == NULL)
+ thesky = this;
}
@@ -55,6 +60,9 @@
{
for (unsigned int i = 0; i < cloud_layers.size(); i++)
delete cloud_layers[i];
+
+ if (this == thesky)
+ thesky = NULL;
}