Merge pull request #14 from nineties/fix_memory_leak

fix memory leak in close-file
This commit is contained in:
Koichi NAKAMURA 2021-05-06 08:13:21 +09:00 committed by GitHub
commit 00fc7168c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2500,7 +2500,14 @@ need-defined (read)
; ;
: close-file ( file -- e ) : close-file ( file -- e )
file>fd @ (close) 0= if success else CLOSE-FILE-ERROR then dup file>fd @ swap
( fd file )
\ release heap objects
dup file>rbuf @ (free)
dup file>wbuf @ (free)
(free)
\ close file object
(close) 0= if success else CLOSE-FILE-ERROR then
; ;
( === File Include === ) ( === File Include === )