Merge pull request #36237 from timothyqiu/memleaks

Fixes memory leaks in GdNavigationServer and RasterizerSceneHighEndRD
This commit is contained in:
Rémi Verschelde 2020-02-15 11:46:27 +01:00 committed by GitHub
commit dee8b10133
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -115,12 +115,15 @@
GdNavigationServer::GdNavigationServer() :
NavigationServer(),
commands_mutex(Mutex::create()),
operations_mutex(Mutex::create()),
active(true) {
commands_mutex = Mutex::create();
operations_mutex = Mutex::create();
}
GdNavigationServer::~GdNavigationServer() {}
GdNavigationServer::~GdNavigationServer() {
memdelete(operations_mutex);
memdelete(commands_mutex);
}
void GdNavigationServer::add_command(SetCommand *command) const {
auto mut_this = const_cast<GdNavigationServer *>(this);

View File

@ -2697,8 +2697,20 @@ RasterizerSceneHighEndRD::~RasterizerSceneHighEndRD() {
RD::get_singleton()->free(view_dependant_uniform_set);
}
storage->free(wireframe_material_shader);
storage->free(overdraw_material_shader);
storage->free(default_shader);
storage->free(wireframe_material);
storage->free(overdraw_material);
storage->free(default_material);
{
RD::get_singleton()->free(scene_state.reflection_buffer);
memdelete_arr(scene_state.instances);
memdelete_arr(scene_state.gi_probes);
memdelete_arr(scene_state.directional_lights);
memdelete_arr(scene_state.lights);
memdelete_arr(scene_state.reflections);
}
}