From 9c3c0250c1c02e10a7ebcc2f5437478f8327eadb Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Thu, 19 Mar 2020 14:39:31 +0100 Subject: [PATCH] Closing file handles directly after they've been payed --- native/serverconnection/src/audio/sounds/SoundPlayer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/native/serverconnection/src/audio/sounds/SoundPlayer.cpp b/native/serverconnection/src/audio/sounds/SoundPlayer.cpp index feb5a6b..5f94145 100644 --- a/native/serverconnection/src/audio/sounds/SoundPlayer.cpp +++ b/native/serverconnection/src/audio/sounds/SoundPlayer.cpp @@ -73,6 +73,8 @@ namespace tc::audio::sounds { void finalize(bool is_destructor_call) { if(this->output_source && global_audio_output) global_audio_output->delete_source(this->output_source); + if(this->file_handle) + this->file_handle = nullptr; if(auto buffer{std::exchange(this->cache_buffer, nullptr)}; buffer) ::free(buffer); if(!is_destructor_call)