Article View: borland.public.cppbuilder.nativeapi
Article #2610Memory Leak - TForm or TStringGrid or DynamicArray
From: Dan Mayo
Date: Mon, 05 Feb 2007 19:10
Date: Mon, 05 Feb 2007 19:10
23 lines
2077 bytes
2077 bytes
I have created some test code that dynamically creates a form; on that form is a button and a string grid. The button click event fills in a number of static objects with random data; then prior to exiting the function posts all that data into the StringGrid; this should in effect clean up those objects when the click even expires leaving just the data in the grid. That much works. However, when I close the form, when is then followed by a delete operator, the memory doesn't appear to be freed (looking at the Virtual Size of the program via the task manager). Reading the TStringGrid help, it looks as though I need to delete the 'objects' in the stringgrid too? How? Is there something else I am missing? I'm still trying to track down the problem I am having where I can't create a new TForm at random times that I posted in "Creating new TForm causes 'Out of Resources' error on WinXP" a few weeks ago. It's not that my program is taking up much memory, or the leak I see in the above test app is that big. I'm grasping at straws to find out what is going on here; any help would be appreciated. Thanks.
Technical Details
Message-ID:
<45c7810f@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,191a7d21d69bde32,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 05 Feb 2007 13:10:15 -0600 From: Dan Mayo <dmayo@dickey-john.com> User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Memory Leak - TForm or TStringGrid or DynamicArray Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 216.174.165.174 Message-ID: <45c7810f@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1170702607 216.174.165.174 (5 Feb 2007 11:10:07 -0800) Lines: 25 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail