Run dtors in reverse order
parent
f1cadef89d
commit
16244ab15a
|
@ -26,11 +26,14 @@ M: destructor dispose
|
||||||
: add-always-destructor ( obj -- )
|
: add-always-destructor ( obj -- )
|
||||||
<destructor> always-destructors get push ;
|
<destructor> always-destructors get push ;
|
||||||
|
|
||||||
|
: dispose-each ( seq -- )
|
||||||
|
<reversed> [ dispose ] each ;
|
||||||
|
|
||||||
: do-always-destructors ( -- )
|
: do-always-destructors ( -- )
|
||||||
always-destructors get [ dispose ] each ;
|
always-destructors get dispose-each ;
|
||||||
|
|
||||||
: do-error-destructors ( -- )
|
: do-error-destructors ( -- )
|
||||||
error-destructors get [ dispose ] each ;
|
error-destructors get dispose-each ;
|
||||||
|
|
||||||
: with-destructors ( quot -- )
|
: with-destructors ( quot -- )
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue