Xojo Conferences
XDCMay2019MiamiUSA

String Property Leaks (Real Studio Plugins Mailinglist archive)

Back to the thread list
Previous thread: Re: Problem with RB 2006r3 beta 3
Next thread: MachO Universal Plugins


macosx and unix paths   -   GOLD
  String Property Leaks   -   Björn Eiríksson <b
   Re: String Property Leaks   -   Jonathan Johnson
   Re: String Property Leaks   -   Björn Eiríksson <b
   Re: String Property Leaks   -   Björn Eiríksson <b
   Re: String Property Leaks   -   Jonathan Johnson
   Re: String Property Leaks   -   Björn Eiríksson <b

String Property Leaks
Date: 15.06.06 23:24 (Thu, 15 Jun 2006 22:24:50 +0000)
From: Björn Eiríksson <b
Hello

I found that string properties with REALstandardGetter and
REALstandardSetter, defined like bellow will leak:

{"Font", "StartupLinuxFont", "String",
REALpropInvalidate,REALstandardGetter,REALstandardSetter, FieldOffset
(TableControlData, StartupLinuxFontName)},

In the Dispose Event of the control then the following is called:

REALUnlockString(me->StartupLinuxFontName);

And the following is called in the Init method of the control:

me->StartupLinuxFontName = REALBuildString("Geneva",6);

The property is not connected to anything else nor accessed or
touched in any other place.

Now why does it leak ? Is it a bug in REALbasic handling of
REALstandardSetter for REALstring ?

If I go to the property browser and change the font name to GenevaXX,
then I will leak 2 more bytes.

Re: String Property Leaks
Date: 15.06.06 23:27 (Thu, 15 Jun 2006 17:27:12 -0500)
From: Jonathan Johnson

On Jun 15, 2006, at 5:24 PM, Björn Eiríksson wrote:

> Hello
>
> I found that string properties with REALstandardGetter and
> REALstandardSetter, defined like bellow will leak:
>
> {"Font", "StartupLinuxFont", "String",
> REALpropInvalidate,REALstandardGetter,REALstandardSetter,
> FieldOffset(TableControlData, StartupLinuxFontName)},
>
> In the Dispose Event of the control then the following is called:
>
> REALUnlockString(me->StartupLinuxFontName);
>
> And the following is called in the Init method of the control:
>
> me->StartupLinuxFontName = REALBuildString("Geneva",6);
>
> The property is not connected to anything else nor accessed or
> touched in any other place.
>
> Now why does it leak ? Is it a bug in REALbasic handling of
> REALstandardSetter for REALstring ?

I doubt it's the latter -- that code hasn't changed in an extremely
long time (before I even started working here). Is your destructor
being called?

-Jon

--

Re: String Property Leaks
Date: 15.06.06 23:30 (Thu, 15 Jun 2006 22:30:39 +0000)
From: Björn Eiríksson <b

On 15.6.2006, at 22:27, Jonathan Johnson wrote:

> I doubt it's the latter -- that code hasn't changed in an extremely
> long time (before I even started working here). Is your destructor
> being called?
>
> -Jon

Yes the entire Grid control gets correctly disposed in the Dispose
event, leaving the byte count of the String properties left.

Note if it is a bug in REALbasic REALstandardSetter then it might not
be a new one at all, I at least have never tested for it before.

Re: String Property Leaks
Date: 15.06.06 23:31 (Thu, 15 Jun 2006 22:31:40 +0000)
From: Björn Eiríksson <b
Ohhh and I forgot, I would not even have suspected it if adding XX to
one of the font properties in the property browser had not added 2
bytes to the leak.

On 15.6.2006, at 22:27, Jonathan Johnson wrote:

>
> On Jun 15, 2006, at 5:24 PM, Björn Eiríksson wrote:
>
>> Hello
>>
>> I found that string properties with REALstandardGetter and
>> REALstandardSetter, defined like bellow will leak:
>>
>> {"Font", "StartupLinuxFont", "String",
>> REALpropInvalidate,REALstandardGetter,REALstandardSetter,
>> FieldOffset(TableControlData, StartupLinuxFontName)},
>>
>> In the Dispose Event of the control then the following is called:
>>
>> REALUnlockString(me->StartupLinuxFontName);
>>
>> And the following is called in the Init method of the control:
>>
>> me->StartupLinuxFontName = REALBuildString("Geneva",6);
>>
>> The property is not connected to anything else nor accessed or
>> touched in any other place.
>>
>> Now why does it leak ? Is it a bug in REALbasic handling of
>> REALstandardSetter for REALstring ?
>
> I doubt it's the latter -- that code hasn't changed in an extremely
> long time (before I even started working here). Is your destructor
> being called?
>
> -Jon
>
> --
> Jonathan Johnson
> <email address removed>
> REAL Software, Inc.
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: String Property Leaks
Date: 15.06.06 23:42 (Thu, 15 Jun 2006 17:42:10 -0500)
From: Jonathan Johnson

On Jun 15, 2006, at 5:30 PM, Björn Eiríksson wrote:

>
> On 15.6.2006, at 22:27, Jonathan Johnson wrote:
>
>> I doubt it's the latter -- that code hasn't changed in an
>> extremely long time (before I even started working here). Is your
>> destructor being called?
>>
>> -Jon
>
> Yes the entire Grid control gets correctly disposed in the Dispose
> event, leaving the byte count of the String properties left.
>
> Note if it is a bug in REALbasic REALstandardSetter then it might
> not be a new one at all, I at least have never tested for it before.

The entire framework would be leaking all over the place if this was
the case. The function used for the standard setter is used for a lot
of the C++ framework also.

So, it only leaks the byte count of the string itself? I would expect
any leak to be of the string header + the length of the string.

How are you determining the leak?

-Jon

--

Re: String Property Leaks
Date: 15.06.06 23:42 (Thu, 15 Jun 2006 22:42:30 +0000)
From: Björn Eiríksson <b
Never mind, sorry about the false alarm, it turned out that old evil
CW was not actually compiling this project target at all, making the
change to call REALUnlockString never get added to the compiled output.

Björn

On 15.6.2006, at 22:31, Björn Eiríksson wrote:

> Ohhh and I forgot, I would not even have suspected it if adding XX
> to one of the font properties in the property browser had not added
> 2 bytes to the leak.
>
> On 15.6.2006, at 22:27, Jonathan Johnson wrote:
>
>>
>> On Jun 15, 2006, at 5:24 PM, Björn Eiríksson wrote:
>>
>>> Hello
>>>
>>> I found that string properties with REALstandardGetter and
>>> REALstandardSetter, defined like bellow will leak:
>>>
>>> {"Font", "StartupLinuxFont", "String",
>>> REALpropInvalidate,REALstandardGetter,REALstandardSetter,
>>> FieldOffset(TableControlData, StartupLinuxFontName)},
>>>
>>> In the Dispose Event of the control then the following is called:
>>>
>>> REALUnlockString(me->StartupLinuxFontName);
>>>
>>> And the following is called in the Init method of the control:
>>>
>>> me->StartupLinuxFontName = REALBuildString("Geneva",6);
>>>
>>>
>>> The property is not connected to anything else nor accessed or
>>> touched in any other place.
>>>
>>> Now why does it leak ? Is it a bug in REALbasic handling of
>>> REALstandardSetter for REALstring ?
>>
>> I doubt it's the latter -- that code hasn't changed in an
>> extremely long time (before I even started working here). Is your
>> destructor being called?
>>
>> -Jon
>>
>> --
>> Jonathan Johnson
>> <email address removed>
>> REAL Software, Inc.
>>
>> _______________________________________________
>> Unsubscribe or switch delivery mode:
>> <http://www.realsoftware.com/support/listmanager/>
>>
>> Search the archives of this list here:
>> <http://support.realsoftware.com/listarchives/lists.html>
>>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>