[Gambas-user] What are circular references, and how to avoid?

ron ronstk at ...239...
Tue Jan 22 18:54:17 CET 2008


On Tuesday 22 January 2008 18:02, Benoit Minisini wrote:
> On mardi 22 janvier 2008, ron wrote:

----8<---------

> > > Easy, you avoid it by not creating circular references. :-)
> > >
> > > A circular reference is when an object A has a variable that points at an
> > > object B, and that at the same time the object B has a variable that
> > > points at the object A.
> >
> > For me it was stopping to use some of those components.
> >
> > Ron
> >
> 
> If you prevent a form from being freed because of a circular reference, then 
> all form contents are not freed too. 
I do understand this.

> For example, if you have a Toolbar inside this form, then you will see 
> internal classes used for implementing this Toolbar in the warning messages.
> Nothing terrible in that... 
True, but it was a big puzzle to follow my mistakes because code I wrote myself does never fails :-)
We all know better this is false but... You know the how the world is. 
Mostly after reading the code again and again you overlook something simple or
miss the logic mistake used in the code.

> 
> If I see the project, I will tell where the circular references come from.
> 
> Regards,
> 

For my own hobby projects it is not so importand but if you try to make
a program at work for handling the stuff at the workplace it sometimes irritate
to much. Special if it is something like I did make in the past with good results.

At the workplace I'm the only one with acknowledge of computers and programming.
No fall back to ask someone to peek into the code for mistake or bad logic.

ATM I'm back to my old job of repairs with the solder iron and multimeter.
Gives me more fun now than anything with computers.
Except gambas that still attracks me how development is going on and on.

Dispite some problems it is the top one I had with a lot of hours fun with it.

Ron the solder boy :-)





More information about the User mailing list