Fixed several leaks in VisualServerScene, RasterizerSceneGLES3 and RasterizerGLES3

(cherry picked from commit e9ac87390c)
This commit is contained in:
Wilson E. Alvarez 2018-03-12 21:40:47 -04:00 committed by Hein-Pieter van Braam
parent 607884139c
commit 9567297a66
5 changed files with 24 additions and 0 deletions

View File

@ -413,4 +413,5 @@ RasterizerGLES3::~RasterizerGLES3() {
memdelete(storage);
memdelete(canvas);
memdelete(scene);
}

View File

@ -5118,3 +5118,23 @@ void RasterizerSceneGLES3::finalize() {
RasterizerSceneGLES3::RasterizerSceneGLES3() {
}
RasterizerSceneGLES3::~RasterizerSceneGLES3() {
memdelete(default_material.get_data());
memdelete(default_material_twosided.get_data());
memdelete(default_shader.get_data());
memdelete(default_shader_twosided.get_data());
memdelete(default_worldcoord_material.get_data());
memdelete(default_worldcoord_material_twosided.get_data());
memdelete(default_worldcoord_shader.get_data());
memdelete(default_worldcoord_shader_twosided.get_data());
memdelete(default_overdraw_material.get_data());
memdelete(default_overdraw_shader.get_data());
memfree(state.spot_array_tmp);
memfree(state.omni_array_tmp);
memfree(state.reflection_array_tmp);
}

View File

@ -852,6 +852,7 @@ public:
void initialize();
void finalize();
RasterizerSceneGLES3();
~RasterizerSceneGLES3();
};
#endif // RASTERIZERSCENEGLES3_H

View File

@ -205,4 +205,5 @@ VisualServerRaster::~VisualServerRaster() {
memdelete(VSG::canvas);
memdelete(VSG::viewport);
memdelete(VSG::rasterizer);
memdelete(VSG::scene);
}

View File

@ -3333,6 +3333,7 @@ VisualServerScene::~VisualServerScene() {
#ifndef NO_THREADS
probe_bake_thread_exit = true;
probe_bake_sem->post();
Thread::wait_to_finish(probe_bake_thread);
memdelete(probe_bake_thread);
memdelete(probe_bake_sem);