[Gambas-user] Me.Close not working as expected

Gianluigi bagonergi at gmail.com
Fri Jul 2 00:18:45 CEST 2021


Hi Charlie,

to understand what I wanted to suggest, you can try this code.
You need a project with an empty class Class1 and a Form with 2 buttons:

Private $bStop As Boolean

  Public Sub Button1_Click()

  Me.Close
  $bStop = True

End

Public Sub Form_Open()

  Dim hClass As New Class1

  Me.Show()
  Do
    Print "Hello"
    Wait 1
    If $bStop Then Break
  Loop

End

Public Sub Button2_Click()

  Me.Close
  Quit

End

in console with Button2 I get:
Hello
Hello
Hello
gbx3 [159986]: warning: circular references detected:
gbx3:     1 Class1
gbx3:     1 FMain
gbx3 [159986]: warning: 4 allocation(s) non freed.

If you write Return instead of Quit, the program continues and does not
close.

Regards

Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210702/042b0ac6/attachment.htm>


More information about the User mailing list