fluidsynth.c
changeset 521 565549e046b0
parent 518 8bc9b5fd2aae
child 532 b8e8ae4852b2
     1.1 --- a/fluidsynth.c	Sat Dec 31 14:23:44 2011 -0500
     1.2 +++ b/fluidsynth.c	Sat Dec 31 18:32:49 2011 -0500
     1.3 @@ -148,9 +148,15 @@
     1.4  	return fluidsynth_loadsong_common(fluidsynth_loadsong_internal, (void*) midifile);
     1.5  }
     1.6  
     1.7 -FluidSynthMidiSong *fluidsynth_loadsong_RW(SDL_RWops *rw)
     1.8 +FluidSynthMidiSong *fluidsynth_loadsong_RW(SDL_RWops *rw, int freerw)
     1.9  {
    1.10 -	return fluidsynth_loadsong_common(fluidsynth_loadsong_RW_internal, (void*) rw);
    1.11 +	FluidSynthMidiSong *song;
    1.12 +
    1.13 +	song = fluidsynth_loadsong_common(fluidsynth_loadsong_RW_internal, (void*) rw);
    1.14 +	if (freerw) {
    1.15 +		SDL_RWclose(rw);
    1.16 +	}
    1.17 +	return song;
    1.18  }
    1.19  
    1.20  void fluidsynth_freesong(FluidSynthMidiSong *song)