complex http example fix
[k8lst.git] / samples / finalize / fintest00.st
blob8a0ba2d1d9b7e5ffceafea52311ba283a5745e59
1 class: FinTest | cid | [
2   | id |
4   ^new [
5     | obj |
6     cid ifNil: [ cid := 0 ].
7     obj := self basicNew.
8     self in: obj at: 1 put: (cid := cid + 1).
9     'adding ' print. cid print. ' to st-finalize list' printNl.
10     obj addToBeFinalized.
11     ^obj
12   ]
14   finalize [
15     'finalizing ' print. id printNl.
16   ]
18   ^runDummy [
19     1 to: 50000 do: [ nil ].
20   ]
25   FinTest new.
26   FinTest new.
27   FinTest new.
28   FinTest new.
29   System gc.
30   System newProcessGroupWith: (Process newWithMethod: #runDummy class: FinTest class).
31   'running REPL' printNl.
32   ^REPL new REPL.