fixed bug, file was not being closed at _finish() time
authorJosh Coalson <jcoalson@users.sourceforce.net>
Sat, 16 Sep 2006 00:08:23 +0000 (00:08 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Sat, 16 Sep 2006 00:08:23 +0000 (00:08 +0000)
src/libOggFLAC/stream_encoder.c

index 53e35b6..06ba7a2 100644 (file)
@@ -341,6 +341,12 @@ OggFLAC_API void OggFLAC__stream_encoder_finish(OggFLAC__StreamEncoder *encoder)
 
        OggFLAC__ogg_encoder_aspect_finish(&encoder->protected_->ogg_encoder_aspect);
 
+       if(0 != encoder->private_->file) {
+               if(encoder->private_->file != stdout)
+                       fclose(encoder->private_->file);
+               encoder->private_->file = 0;
+       }
+
        set_defaults_(encoder);
 
        encoder->protected_->state = OggFLAC__STREAM_ENCODER_UNINITIALIZED;