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");
humidity = new FloatNode(this, "humidity");
sun_radius = new FloatNode(this, "sun_radius");
sun_color = COLOR_RED;
}
AtmosphereDefinition::~AtmosphereDefinition() {

View file

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