Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Misc > Re: Dynamic arr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 13 Topic 6010 of 6137
Post > Topic >>

Re: Dynamic arrays of record/object

by Rob Kennedy <me3@[EMAIL PROTECTED] > Mar 13, 2008 at 01:07 AM

Hans-Peter Diettrich wrote:
> sakkieLFS@[EMAIL PROTECTED]
 wrote:
>> procedure TForm1.Button1Click(Sender: TObject);
>> var Data: TXMLSectionData;
>> begin
>>   Data.Create;
>>   Data.AddSection('Header1','test data');
>>
>> end;
> 
> The object in the local variable will be lost (memory leak) on exit from

> the method :-(
> 
> Move the "var Data..." line into the form class, the "Data.Create" into 
> the form constructor, and add Data.Free to the form destructor.

Actually, you want to move the expression "Data.Create" into the 
bitbucket. <g>

-- 
Rob
 




 13 Posts in Topic:
Dynamic arrays of record/object
sakkieLFS@[EMAIL PROTECTE  2008-03-12 11:46:46 
Re: Dynamic arrays of record/object
Rob Kennedy <me3@[EMAI  2008-03-12 18:31:17 
Re: Dynamic arrays of record/object
"Maarten Wiltink&quo  2008-03-13 10:28:13 
Re: Dynamic arrays of record/object
Hans-Peter Diettrich <  2008-03-12 23:08:41 
Re: Dynamic arrays of record/object
Rob Kennedy <me3@[EMAI  2008-03-13 01:07:21 
Re: Dynamic arrays of record/object
sakkieLFS@[EMAIL PROTECTE  2008-03-12 22:57:12 
Re: Dynamic arrays of record/object
Rob Kennedy <me3@[EMAI  2008-03-13 01:05:32 
Re: Dynamic arrays of record/object
sakkieLFS@[EMAIL PROTECTE  2008-03-12 23:09:38 
Re: Dynamic arrays of record/object
Hans-Peter Diettrich <  2008-03-13 17:15:23 
Re: Dynamic arrays of record/object
sakkieLFS@[EMAIL PROTECTE  2008-03-12 23:21:59 
Re: Dynamic arrays of record/object
sakkieLFS@[EMAIL PROTECTE  2008-03-12 23:56:26 
Re: Dynamic arrays of record/object
Jamie <jamie_ka1lpa_no  2008-03-13 19:04:01 
Re: Dynamic arrays of record/object
"alanglloyd@[EMAIL P  2008-03-13 02:32:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Sep 5 12:11:35 CDT 2008.