Free the audiofile structs on st_close

Otherwise they leak
This commit is contained in:
Paul Ferrand 2020-10-30 11:49:22 +01:00
parent 9d477b4462
commit db5911f811
2 changed files with 4 additions and 4 deletions

View file

@ -155,7 +155,7 @@ void st_close(st_audio_file* af)
break;
}
af->type = st_audio_file_null;
free(af);
}
int st_get_type(st_audio_file* af)

View file

@ -52,10 +52,10 @@ st_audio_file* st_open_file_w(const wchar_t* filename)
void st_close(st_audio_file* af)
{
if (af->snd) {
if (af->snd)
sf_close(af->snd);
af->snd = NULL;
}
free(af);
}
int st_get_type(st_audio_file* af)