mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-12 01:30:49 +01:00
Closes file handles on file close, no longer crashes if files don't exist, minor config dialog fix
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@752 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
6c4e00ccd0
commit
788e397b4e
@ -177,7 +177,7 @@ bool vgmstreamPreferences::HasChanged()
|
||||
if(FadeDelay != uGetDlgItemText(m_hWnd, IDC_FADE_DELAY_SECONDS)) return true;
|
||||
if(LoopCount != uGetDlgItemText(m_hWnd, IDC_LOOP_COUNT)) return true;
|
||||
|
||||
int Priority = 6 - SendDlgItemMessage(IDC_THREAD_PRIORITY_SLIDER, TBM_GETPOS, 0, 0);
|
||||
int Priority = SendDlgItemMessage(IDC_THREAD_PRIORITY_SLIDER, TBM_GETPOS, 0, 0);
|
||||
if(Priority != cfg_Priority) return true;
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -144,9 +144,9 @@ static off_t get_offset_foo(FOO_STREAMFILE *streamFile) {
|
||||
}
|
||||
|
||||
static void close_foo(FOO_STREAMFILE * streamfile) {
|
||||
//fclose(streamfile->infile);
|
||||
streamfile->m_file.release();
|
||||
free(streamfile->buffer);
|
||||
free(streamfile);
|
||||
free(streamfile);
|
||||
}
|
||||
|
||||
static void get_name_foo(FOO_STREAMFILE *streamfile,char *buffer,size_t length) {
|
||||
|
@ -60,6 +60,8 @@ void input_vgmstream::open(service_ptr_t<file> p_filehint,const char * p_path,t_
|
||||
|
||||
/* were we able to open it? */
|
||||
if (!vgmstream) {
|
||||
/* Generate exception if the file is unopenable*/
|
||||
throw exception_io_data();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -70,6 +72,7 @@ void input_vgmstream::open(service_ptr_t<file> p_filehint,const char * p_path,t_
|
||||
if (vgmstream->channels <= 0) {
|
||||
close_vgmstream(vgmstream);
|
||||
vgmstream=NULL;
|
||||
throw exception_io_data();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -227,6 +230,9 @@ input_vgmstream::input_vgmstream() {
|
||||
}
|
||||
|
||||
input_vgmstream::~input_vgmstream() {
|
||||
if(vgmstream)
|
||||
close_vgmstream(vgmstream);
|
||||
vgmstream=NULL;
|
||||
}
|
||||
|
||||
t_filestats input_vgmstream::get_file_stats(abort_callback & p_abort) {
|
||||
|
Loading…
Reference in New Issue
Block a user