Stupid me: | x array | x := OrderedCollection new. array := WeakArray with: x. x := nil. Smalltalk garbageCollect. array first ==> nil. Ok, this being the case the original question still remains: Is there any effort to make Announcements only use weak references? I am not much of a specialist in this, but I would be first hand interested in helping out. Cheers, Doru On 7 Jan 2011, at 08:00, Lukas Renggli wrote:
On Friday, 7 January 2011, Tudor Girba <tudor.girba@gmail.com> wrote:
Hi,
Are there any plans to get Announcements use weak references?
I saw that in the repository of Lukas, there is a WeakAnnouncer. However, here the subscriptions are still held in a regular Dictionary.
Actually, I am not sure what is the status of weak references. I tried the following, but it does not seem to work:
| x array | x := GLMPane new. array := WeakArray with: x. x := nil. Smalltalk garbageCollect. array size
==> 1
Arrays never change their size, it is the value of the fisrt slot that changes to 0 or nil (i don't remember).
Lukas
Cheers, Doru
-- www.tudorgirba.com
"We cannot reach the flow of things unless we let go."
-- Lukas Renggli www.lukas-renggli.ch
-- www.tudorgirba.com "In a world where everything is moving ever faster, one might have better chances to win by moving slower."