Re: [fpc-pascal] memory management with open arrays and classes

2008-06-26 Thread Jonas Maebe
On 23 Jun 2008, at 11:21, Joost van der Sluis wrote: Op zaterdag 21-06-2008 om 19:23 uur [tijdzone -0700], schreef David Emerson: 1. If the setlength function is creating an array of things which happen to be stored as pointers (ansistrings in str_arr or class instances in cls_arr) then wi

Re: [fpc-pascal] memory management with open arrays and classes

2008-06-26 Thread David Emerson
Thanks, Joost, for all of your answers! It looks like I need to write *more* cleanup code, and double-check it all. One question remains: > After calling setlength, the items in the array are not initialised. > > [...] > > Initialising the strings you can do by setting them to an empty > stri

Re: [fpc-pascal] memory management with open arrays and classes

2008-06-23 Thread Joost van der Sluis
Op zaterdag 21-06-2008 om 19:23 uur [tijdzone -0700], schreef David Emerson: > I'm pretty new to both "open arrays" and OOP, and am feeling a bit > concerned about memory management and leaks in my code. I will jump > straight into examples and questions: I think you can find all this in the do

[fpc-pascal] memory management with open arrays and classes

2008-06-21 Thread David Emerson
Hi all, I'm pretty new to both "open arrays" and OOP, and am feeling a bit concerned about memory management and leaks in my code. I will jump straight into examples and questions: type T_my_object = object (TObject) {...} end; T_my_class = class (TComponent) {...} end