[Gambas-user] getting warning when quitting running application

Bruce Steers bsteers4 at gmail.com
Wed May 11 20:40:40 CEST 2022


or even like your method ...

Public Sub BCloseProgram_Click()

For Each w As Window In Windows
    w.Close()
  Next

End


On Wed, 11 May 2022 at 19:37, Bruce Steers <bsteers4 at gmail.com> wrote:

>
> Easiest way would be...
>
> Public Sub Form_Close()
>
>   For Each w As Window In Windows
>    if w <> Me.Window Then w.Close()
>   Next
> End
>
>
> On Wed, 11 May 2022 at 18:13, Charles Bukowski <
> charlesbukowski.italy at gmail.com> wrote:
>
>> I fixed it listing all forms into a button click event and using close
>> method :
>> Public Sub BCloseProgram_Click()
>> Me.Close
>> Main.Close
>> End
>> This way console warning disappears.
>> I am just trying to program with this language and I've used it to create
>> a simple two forms application.
>> Is there a way to "index" and apply close method to all open forms, in
>> case of an application made of many, in order to completely close it and
>> freeing all allocated resources?
>> thx
>>
>> Il giorno mer 11 mag 2022 alle ore 18:13 Bruce Steers <bsteers4 at gmail.com>
>> ha scritto:
>>
>>>
>>>
>>> On Wed, 11 May 2022 at 16:59, Charles Bukowski <
>>> charlesbukowski.italy at gmail.com> wrote:
>>>
>>>> Hi, I am using quit command to end an application.
>>>> But I get the following from the ide console  :
>>>> gbx3 [4289]: warning: 1 allocation(s) non freed.
>>>> Is there a way to understand what is allocating resources and destroy
>>>> it? Or can this warning being ignored?
>>>> thx
>>>>
>>>
>>> It will probably be some kind of object that was created and needs to be
>>> destroyed.
>>>
>>> Are you using Quit because the application won't exit cleanly otherwise?
>>> (that's never really the best way to go)
>>>
>>> Make sure all file handles / timers / processes are stopped/killed
>>>
>>> Add a few object killing things to your Form_Close() event like..
>>>
>>> ThisObjectCreated = Null
>>> ThisOtherObjectCreated = Null
>>>
>>> without seeing your code it's hard to guess what it could be.
>>>
>>> As for an actual way to track down exactly what it is there may be a
>>> debug option but i forget it.
>>>
>>> BruceS
>>>
>>>
>>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220511/9c35cb75/attachment-0001.htm>


More information about the User mailing list