Fixed a potential segfault at program exit

This commit is contained in:
Michaël Lemaire 2015-12-16 10:36:21 +01:00
parent d2b4a1ea5e
commit 86e6539af9
2 changed files with 7 additions and 6 deletions

View file

@ -13,6 +13,7 @@ AtmosphereDefinition::AtmosphereDefinition(DefinitionNode *parent)
daytime = new FloatNode(this, "daytime"); daytime = new FloatNode(this, "daytime");
humidity = new FloatNode(this, "humidity"); humidity = new FloatNode(this, "humidity");
sun_radius = new FloatNode(this, "sun_radius"); sun_radius = new FloatNode(this, "sun_radius");
sun_color = COLOR_RED;
} }
AtmosphereDefinition::~AtmosphereDefinition() { AtmosphereDefinition::~AtmosphereDefinition() {

View file

@ -50,15 +50,15 @@ OpenGLVegetation::OpenGLVegetation(OpenGLRenderer *renderer) : OpenGLPart(render
} }
OpenGLVegetation::~OpenGLVegetation() { OpenGLVegetation::~OpenGLVegetation() {
for (auto layer : layers) { updater->interrupt();
delete layer; delete updater;
}
layers.clear();
delete layers_lock; delete layers_lock;
updater->interrupt(); for (auto &layer: layers) {
delete updater; delete layer;
}
layers.clear();
} }
void OpenGLVegetation::initialize() { void OpenGLVegetation::initialize() {