Free the audiofile structs on st_close
Otherwise they leak
This commit is contained in:
parent
9d477b4462
commit
db5911f811
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
af->type = st_audio_file_null;
|
free(af);
|
||||||
}
|
}
|
||||||
|
|
||||||
int st_get_type(st_audio_file* 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)
|
void st_close(st_audio_file* af)
|
||||||
{
|
{
|
||||||
if (af->snd) {
|
if (af->snd)
|
||||||
sf_close(af->snd);
|
sf_close(af->snd);
|
||||||
af->snd = NULL;
|
|
||||||
}
|
free(af);
|
||||||
}
|
}
|
||||||
|
|
||||||
int st_get_type(st_audio_file* af)
|
int st_get_type(st_audio_file* af)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue