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

Rolf-Werner Eilert eilert-sprachen at ...221...
Tue Jan 22 12:18:24 CET 2008


Jaap Cramer schrieb:
> Hi
> 
> I have a question. I Got, after exiting a fine working project this message in console:
> 
> WARNING: circular references detected
> FToolBar (3)
> FHistory (1)
> FBible (1)
> FOptions (1)
> FLoad (1)
> ToolPanelContainer (3)
> FExpander (1)
> ToolPanel (1)
> Expander (1)
> WARNING: 251 allocation(s) non freed.
> 
> What is it
> how serious is this :-)
> and how do I avoid it?
> 
> Jaap
> 


When you've got two SUBs with events which call each other, i. e. event 
SUB A calls SUB B which triggers an event that calls SUB A and so on.

Or if you've got two SUBs with variables that influence each other, i. 
e. variable A affects variable B which affects variable A which affects 
variable B....

Take a look at your program code if there's something of this kind. 
Sometimes it's pretty difficult to find because you just don't expect 
the thing to live at that place... I often do not know that changing a 
certain property in an object will call a certain event, and sometimes I 
forgot I already added some code to this event (to do something 
completely else) which in turn now changes the property ;-) Sometimes it 
helps to watch the program step by step, a real eye-opener!

Rolf





More information about the User mailing list