On 27 May 2013 16:21, Igor Stasenko <siguc...@gmail.com> wrote: > On 27 May 2013 12:28, Henrik Johansen <henrik.s.johan...@veloxit.no> wrote: >> >> On May 27, 2013, at 11:44 AM, Henrik Johansen wrote: >> >>> >>> On May 25, 2013, at 1:11 PM, Stéphane Ducasse wrote: >>> >>>> Hi guys >>>> >>>> why there is no variant to on:send:to: >>>> "SystemAnnouncer uniqueInstance on: AddedLog send: #foo to: self. " >>>> that pass also the announcement? >>>> >>>> Just because it is better to use on:do;? >>>> >>>> Stef >>>> >>> Huh? >>> It should work do do >>> SystemAnnouncer uniqueInstance on: AddedLog send: #foo: to: self >>> >>> and get the announcement as argument… >>> >>> or #foo:bar: >>> to get the announcer as well as the announcement. >>> >>> This is one of the reasons cull: is cool! ;) >>> >>> Cheers, >>> Henry >>> >> >> Speaking of SystemAnnouncer… >> In the latest dev image I've got: >> SystemAnnouncer uniqueInstance numberOfSubscriptions 1327 >> >> Most of which are weak subscriptions for RecentMessageList. >> >> RecentMessageList class >> cleanUp >> >> self allInstancesDo: [:rml| rml initialize]. >> >> is clearly wrong, as initialize registers subscriptions for the >> announcements (thus introducing duplicates), done every time you shut down >> the image… >> >> maybe it should do >> self resetUniqueInstance instead? >> > > i think > RecentMessageList>>registerToAnnouncements > > should include > > SystemAnnouncer uniqueInstance unsubscribe: self. > > > like that, even if you call #initialize multiple times, it won't > create duplicates. >
tried it, with the change: SystemAnnouncer uniqueInstance numberOfSubscriptions 467 RecentMessageList cleanUp SystemAnnouncer uniqueInstance numberOfSubscriptions 93 > -- > Best regards, > Igor Stasenko. -- Best regards, Igor Stasenko.