mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-23 22:41:05 +01:00
audacious: Remove file leaks
This commit is contained in:
parent
74475a3846
commit
4bfdcbe46d
@ -142,10 +142,11 @@ bool VgmstreamPlugin::is_our_file(const char * filename, VFSFile & file) {
|
||||
if (!sf) return false;
|
||||
|
||||
VGMSTREAM* infostream = init_vgmstream_from_STREAMFILE(sf);
|
||||
close_streamfile(sf);
|
||||
if (!infostream) {
|
||||
close_streamfile(sf);
|
||||
return false;
|
||||
}
|
||||
close_vgmstream(infostream);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -229,12 +230,11 @@ static bool read_info(const char* filename, Tuple & tuple) {
|
||||
sf->stream_index = subtune;
|
||||
|
||||
VGMSTREAM* infostream = init_vgmstream_from_STREAMFILE(sf);
|
||||
close_streamfile(sf);
|
||||
if (!infostream) {
|
||||
close_streamfile(sf);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int total_subtunes = infostream->num_streams;
|
||||
|
||||
// int was changed to short in some version, though vgmstream formats can exceed it
|
||||
@ -245,7 +245,6 @@ static bool read_info(const char* filename, Tuple & tuple) {
|
||||
//set nullptr to leave subsong index linear (must add +1 to subtune)
|
||||
tuple.set_subtunes(total_subtunes, nullptr);
|
||||
|
||||
close_streamfile(sf);
|
||||
close_vgmstream(infostream);
|
||||
return true;
|
||||
}
|
||||
@ -339,11 +338,9 @@ static bool read_info(const char* filename, Tuple & tuple) {
|
||||
|
||||
vgmstream_tags_close(tags);
|
||||
close_streamfile(sf_tags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
close_streamfile(sf);
|
||||
close_vgmstream(infostream);
|
||||
|
||||
return true;
|
||||
@ -396,7 +393,6 @@ bool VgmstreamPlugin::play(const char * filename, VFSFile & file) {
|
||||
|
||||
if (!vgmstream) {
|
||||
AUDINFO("filename %s is not a valid format\n", filename);
|
||||
close_vgmstream(vgmstream);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -405,7 +401,6 @@ bool VgmstreamPlugin::play(const char * filename, VFSFile & file) {
|
||||
|
||||
//todo apply config
|
||||
|
||||
|
||||
apply_config(vgmstream, &settings);
|
||||
|
||||
int input_channels = vgmstream->channels;
|
||||
|
Loading…
Reference in New Issue
Block a user