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

Jaap Cramer jaap_cramer at ...67...
Tue Jan 22 12:23:39 CET 2008


Haha

Looks easy :-) Here is then my case

I use a Module to load a Form. I have a Form, and I want to read the controls of that form. But when If I declared two Forms, say Module.mF1 and Module.mF2 as NEW FMain. How can I read data from mF1 to mF2? If in the Form.Class 
Or is that not possible?
I am not having this problem; its just hypothetical. But I wonder, what else would be the use of declaring a Form, if you cant use it twice of more?

Jaap

----------------------------------------
> From: gambas at ...1...
> To: gambas-user at lists.sourceforge.net
> Date: Tue, 22 Jan 2008 11:42:53 +0100
> Subject: Re: [Gambas-user] What are circular references, and how to avoid?
> 
> On mardi 22 janvier 2008, Jaap Cramer wrote:
>> 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
>>
> 
> 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. 
> 
> The interpreter is not clever enough to deal with that, and cannot free the 
> two objects. It just can print a warning at the end of the program, and write 
> the list of classes having objects non freed.
> 
> Regards,
> 
> -- 
> Benoit Minisini
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user

_________________________________________________________________
De mooiste afbeeldingen van Angelina Jolie vind je met Live Search
http://search.live.com/images/results.aspx?q=angelina%20jolie&FORM=MIINTM



More information about the User mailing list