mirror of
https://github.com/nineties/planckforth
synced 2024-12-26 21:58:42 +01:00
fix memory leak in close-file
This commit is contained in:
parent
938d6fe1b6
commit
72edf5a953
1 changed files with 8 additions and 1 deletions
|
@ -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 === )
|
||||||
|
|
Loading…
Reference in a new issue