[Cuis-dev] Primitive fail when:send:to:withArguments:

Juan Vuletich JuanVuletich at zoho.com
Sat May 21 08:26:28 PDT 2022


On 5/18/2022 12:25 PM, Hilaire Fernandes via Cuis-dev wrote:
> Hi Juan,
>
> Now it does not fail.
>
> But there is a strange behavior, for some object it is not registered 
> correctly. In the code below:
>
> visitArrayPreference: aPref
>     | list listMorph |
>     aPref isTypeAClass ifTrue: [^ self visitArrayClassPreference: aPref].
>     listMorph  _ DropDownListMorph
>         model: (list _ ListModel with: aPref type)
>         listGetter: #list
>         indexGetter: #listIndex
>         indexSetter: #listIndex: ::
>         autoDeselect: false;
>         setBalloonText: aPref description.
>     list listIndex: (aPref type indexOf: aPref value).
>     list when: #listSelectionChanged send: #changedList:for: to: self 
> withArguments: {list. aPref}.
>     list inspect.
>     views at: aPref name capitalized put: listMorph
>
>
> For the preferernce guiElementsSize, the actionMap of the list looks 
> correct:
>
>  an IdentityDictionary(#changed:->#(WeakMessageSend(#update: -> *)
>  WeakMessageSend(#update: -> )) 
> #listSelectionChanged->WeakMessageSend(#changedList:for: -> a 
> PreferenceBrowserVisitor) )
>
>
> But for other preference (#atMinusDigitMeaning), some part missing in 
> the actionMap, the destination of #changeList:for is nil:
>
> an IdentityDictionary(#changed:->#(WeakMessageSend(#update: -> *)
>  WeakMessageSend(#update: -> )) 
> #listSelectionChanged->WeakMessageSend(#changedList:for: -> nil) )
>
> If I put a halt in the middle if the method, the actionMap is then 
> correct. Looks like race condition issues?
>
> I will try to investigate later.
>
> Hilaire
>

The event system holds receiver and arguments weakly. If there is no 
other reference to them, they get garbage collected.

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
https://independent.academia.edu/JuanVuletich
https://www.researchgate.net/profile/Juan-Vuletich
https://patents.justia.com/inventor/juan-manuel-vuletich
https://twitter.com/JuanVuletich



More information about the Cuis-dev mailing list