Santiago A. wrote:
In TDerivedArrayString I need to manually set the length of the list to
zero. If I don't, the memory is not freed, but in TSimpleArrayString it
frees memory.
Is it also a known bug of 2.6.4?
Yes, it was fixed at the same time IIRC.
Jonas
___
El 23/12/2015 a las 18:24, Jonas Maebe escribió:
> Santiago Amposta wrote:
>
>
> This is a bug in FPC 2.6.4 (it did not initialise managed fields of
> parent objects for child objects that do not declare extra managed
> fields). It is fixed in FPC 3.0.
>
I have used constructors as a workaround no
Santiago Amposta wrote:
I use fpc 2.6.4 and I have a problem of memory leaks, strange errors,
etc. Finally I have tracked it to this:
TSimpleArrayString=object
List:array of String;
end;
TDerivedArrayString=object(TSimpleArrayString)
other_field:integer;
end;
procedure TestSimple;
v
On 23/12/15 16:06, Santiago A. wrote:
> El 23/12/2015 a las 16:24, Lukasz Sokol escribió:
>> On 23/12/15 09:37, Santiago Amposta wrote:
>> I might be wrong... but I just tried:
>>
>> ...
>
> What's the conclusion? As far as I see, there is some kind of bug.
>
> There is no reason for getting
I think for both Record or Object, you need to initialize any dynamic
array or strings fields before using them.
If you don't use any constructor , you need to initialize the fields
yourself.
Being an object, just gives you the added automatic zeroing of its
content. Advanced Record does not
El 23/12/2015 a las 16:49, Dennis Poon escribió:
>
>
> Even if it is an object, you can still define a constructor.
> A constructor should initialize the memory area of the object to 0,
> even if you don't explicitly assign List := nil;
> It is safer to call this constructor before you handle the L
El 23/12/2015 a las 16:24, Lukasz Sokol escribió:
> On 23/12/15 09:37, Santiago Amposta wrote:
> I might be wrong... but I just tried:
>
> ...
What's the conclusion? As far as I see, there is some kind of bug.
There is no reason for getting different results depending on how you
execute two
Santiago A. wrote:
El 23/12/2015 a las 12:13, Dennis Poon escribió:
Did you call A.Create before calling TestDerived? Maybe A.List was not
initialized (which is done in constructor Create) and contains an
invalid pointer (to dynamic array of string).
When you call SetLength, it decrements the
On 23/12/15 09:37, Santiago Amposta wrote:
> Hello:
> I use fpc 2.6.4 and I have a problem of memory leaks, strange errors,
> etc. Finally I have tracked it to this:
>
> TSimpleArrayString=object
> List:array of String;
> end;
>
> TDerivedArrayString=object(TSimpleArrayString)
> other_fie
On 23/12/2015 11:40, Santiago A. wrote:
It's an object, not a class inherited from Tobject, so it hasn't create
constructor.
Try this:
program simpleObjConsole;
type
{ TSimpleArrayString }
TSimpleArrayString=object
public
List:array of String;
constructor Init;
destructo
El 23/12/2015 a las 12:13, Dennis Poon escribió:
>
>
> Santiago Amposta wrote:
>> Hello:
>> I use fpc 2.6.4 and I have a problem of memory leaks, strange errors,
>> etc. Finally I have tracked it to this:
>>
>> TSimpleArrayString=object
>> List:array of String;
>> end;
>>
>> TDerivedArrayStrin
Santiago Amposta wrote:
Hello:
I use fpc 2.6.4 and I have a problem of memory leaks, strange errors,
etc. Finally I have tracked it to this:
TSimpleArrayString=object
List:array of String;
end;
TDerivedArrayString=object(TSimpleArrayString)
other_field:integer;
end;
procedure TestS
12 matches
Mail list logo