Merge pull request #534 from paulfd/audiofile-leaks
Free the audiofile structs on `st_close`
This commit is contained in:
commit
9aded8ce4f
2 changed files with 4 additions and 4 deletions
2
external/st_audiofile/src/st_audiofile.c
vendored
2
external/st_audiofile/src/st_audiofile.c
vendored
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue