Fixed several leaks in VisualServerScene, RasterizerSceneGLES3 and RasterizerGLES3

This commit is contained in:
Wilson E. Alvarez 2018-03-12 21:40:47 -04:00
parent eceba5aa6a
commit e9ac87390c
5 changed files with 24 additions and 0 deletions

View file

@ -415,4 +415,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);