[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is someone can tell me


Le dim. 21 sept. 2025 à 21:38, Bruce Steers <bsteers4@xxxxxxxxx> a écrit :

>
>
> On Sun, 21 Sept 2025 at 20:31, Lee <t.lee.davidson@xxxxxxxxx> wrote:
>
>> On 9/21/25 3:19 PM, Lee wrote:
>> > On 9/21/25 11:27 AM, Fabien Bodard wrote:
>> >> Why have I non freed allocation in this project ???
>> >>
>> >> Thanks
>> >
>> > I can't get far enough in the execution to even have a non-freed
>> allocation. I get an exception at MyQuery:17, "Type mismatch:
>> > wanted Object, got String instead"
>> >
>> > Gambas v3.20.4
>>
>> I fixed that by testing if TypeOf(Table) = gb.String *first* (same for
>> TypeOf({Fields}) = gb.String). But, I do not get any
>> non-freed allocations.
>>
>>
>> --
>> Lee
>
>
> That move actually fixes the problem.
>
> I tried it earlier and got the same non freed allocations warning and
> could not figure out what it was.
> I moved the If conditions around the same as you did and now the bug has
> gone.
>
> Respects
>
> BruceS
>
>

Thank you both BruceS, Lee 😂...

This Way :
  If TypeOf(Tables) = gb.String Then
    $aTables = New String[][]
    a = New String[]
    a.Add(Tables)
    $aTables.Add(a)
  Else If tables Is String[][] Then
    $aTables = Tables
  Else If Table Is String[] Then
    $aTables = New String[][]
    For Each s In Tables
      a = New String[]
      a.Add(s)
      $aTables.Add(a)
    Next
  Endif

The error is gone ... but it's really strange... as I do not create any
object in the first attempt.

A hidden weird bug ... No way to trace the allocated memories ? Gambas know
he has some ref allocated and not freed .

For me who uses many objects often with many refs ... even if I take care
to not store multiple references ... this part of gambas is a nightmare. (I
know it is not only this language).

A tool to help to hunt all these loosen memories ... will be a dream.


thank you again
-- 
Fabien Bodard

References:
Is someone can tell meFabien Bodard <gambas.fr@xxxxxxxxx>
Re: Is someone can tell meLee <t.lee.davidson@xxxxxxxxx>
Re: Is someone can tell meLee <t.lee.davidson@xxxxxxxxx>
Re: Is someone can tell meBruce Steers <bsteers4@xxxxxxxxx>