[Q][Connectors] Locking ends?

Ned Konz ned at bike-nomad.com
Sun Jul 13 18:14:45 UTC 2003


On Sunday 13 July 2003 09:45 am, German Morales wrote:
> It seems that Ned Konz wrote:
> >> I took that approach, doing a quick hack that seems to work.
> >> I modified #mouseDownInConnected: this way:
> >
> > [snip]
> >
> > I did the same thing, more or less, but added a check on the
> > attached morph as well.
>
> It can be nil, right?

Yes. Obviously you want to check for that.

> #firstInput uses "self inputs", which removes nil entries, while
> #input uses the instance variable "inputs" directly, resulting in
> the possibility of a nil response.
>
> Nils are only possible given that this is a WeakArray or there is
> another possibility?

No, #connectToNothing explicitly sets it to nil (I think).

I have recently squashed some bugs having to do with direct references 
to the inputs instvar. For instance, there was one case where in the 
step method I'd go "inputs first" or something, and then later do the 
same thing, and in between the input had been GC'd. So now I have 
assignments to locals just to keep the input from being GC'd during a 
method. And #inputs now returns a non-Weak array.

> From/To, Source/Target, Start/Finish?
> I suppose the problem is because those names give the idea of a
> directed graph, which is not always the case.

Yes, that's been my problem.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list