From 713cf91f2a99d4f33e9206053bcbde64ca70f6c5 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 15 Aug 2008 16:13:13 -0500 Subject: [PATCH] Fix memory leak --- basis/io/ports/ports.factor | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/basis/io/ports/ports.factor b/basis/io/ports/ports.factor index 26b06dba8b..631f491b18 100755 --- a/basis/io/ports/ports.factor +++ b/basis/io/ports/ports.factor @@ -4,7 +4,7 @@ USING: math kernel io sequences io.buffers io.timeouts generic byte-vectors system io.encodings math.order io.backend continuations debugger classes byte-arrays namespaces splitting grouping dlists assocs io.encodings.binary summary accessors -destructors ; +destructors combinators ; IN: io.ports SYMBOL: default-buffer-size @@ -133,10 +133,12 @@ M: output-port stream-flush ( port -- ) M: output-port dispose* [ - [ handle>> &dispose drop ] - [ port-flush ] - [ handle>> shutdown ] - tri + { + [ handle>> &dispose drop ] + [ port-flush ] + [ handle>> shutdown ] + [ buffer>> dispose ] + } cleave ] with-destructors ; M: buffered-port dispose*