]> gitweb.factorcode.org Git - factor.git/commitdiff
don't leak the Factor stream when the vorbis-stream finishes
authorJoe Groff <arcata@gmail.com>
Tue, 26 Jan 2010 04:27:07 +0000 (20:27 -0800)
committerJoe Groff <arcata@gmail.com>
Tue, 26 Jan 2010 04:28:45 +0000 (20:28 -0800)
extra/audio/vorbis/vorbis.factor

index 7fce2b4316173e8256687ed112c77bfbaff5c7c1..78f637770fd67d41e6a75572b6755bbb11599bbf 100644 (file)
@@ -233,7 +233,7 @@ PRIVATE>
     ] with-destructors ;
 
 : read-vorbis-stream ( filename buffer-size -- vorbis-stream )
-    [ binary <file-reader> ] dip <vorbis-stream> ; inline
+    [ [ binary <file-reader> |dispose ] dip <vorbis-stream> ] with-destructors ; inline
 
 M: vorbis-stream dispose*
     {
@@ -246,6 +246,7 @@ M: vorbis-stream dispose*
         [ page>>         [ free ] when* ]
         [ sync-state>>   [ free ] when* ]
         [ packet>>       [ free ] when* ]
+        [ stream>>       [ dispose ] when* ]
     } cleave ;
 
 M: vorbis-stream generator-audio-format