complex http example fix
[k8lst.git] / samples / finalize / fintest01.st
blob37c0cbfd8553d03003599a633b4cfc32e8b89758
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.
31   System newProcessGroupWith: (Process newWithMethod: #runDummy class: FinTest class).
32   'running REPL' printNl.
33   ^REPL new REPL.
35   "[ true ] whileTrue: [ nil ]."
36   System eventWaitFor: 6699.