[Gambas-user] circular reference in menubar
Benoit Minisini
gambas at ...1...
Tue May 27 13:22:56 CEST 2008
On mardi 27 mai 2008, Jaap Cramer wrote:
> Hello
>
> I am tryping te remove my circular references. I use different forms,
> with menus. I discoverd, when I remove the menubar-items, the amount of
> circular referenced decrease. (see example below)
> Is this normal behaviour? Should I delete all menu-items, created with
> the menu editor; couldn't this be done automaticly?
>
> PUBLIC SUB Form_Close()
> Settings["Window/x"] = ME.ScreenX
> Settings["Window/y"] = ME.ScreenY
> Settings["Window/w"] = ME.W
> Settings["Window/h"] = ME.H
> Settings["Last/book"] = cbBooks.Index
> Settings["Last/chap"] = tbChap.Text
> Settings["Options/transState"] = CBool(tglTrans.Value)
>
> 'these lines decrease the amount of circular references
> ME.Menu1.Delete
> ME.Menu2.Delete
> ME.Menu3.Delete
> ME.Menu4.Delete
> ME.Menu5.Delete
> ME.Menu6.Delete
>
> mH.zQuit
> END
>
> grt,
> Jaap
>
You are trying to fix the symptoms, not the cause.
First ensure that:
- You do not use the QUIT nstruction.
- You always use the Close() method to close a form.
- You do not store any reference on a form, or if you do, you release it by
hand.
Regards,
--
Benoit Minisini
More information about the User
mailing list