Closing file handles directly after they've been payed

This commit is contained in:
WolverinDEV 2020-03-19 14:39:31 +01:00
parent ad0d966bd8
commit 9c3c0250c1
1 changed files with 2 additions and 0 deletions

View File

@ -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)