If you want to check for memory leaks, compile your app with FastMM or MemCheck. Either one will point out your memory leaks.
Regards Sean --------------------------------------- Sean Cross mailto:[EMAIL PROTECTED] Pics Print - The photo printing solution for Windows. http://www.picsprint.com Rental Property Manager: Rental management made easy http://www.Intuitex.com > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Richard R > Sent: 15 November 2005 9:40 a.m. > To: 'Delphi-Talk Discussion List' > Subject: memory management with TListView > > > Hello. I'm adding a undo system into the software I am > developing. I created > a TObject derived class to handle the data required to > perform a 1 level > undo/redo. However, I am concerned about the memory being > allocated and > freed. > > The class does not allocate any memory, just initializes it's > own variables. > > I am adding each TpmUndo object into the list view like this > lvPM.AddItem(caption, TpmUndo.Create(a pointer to a abstract object)); > > And in a OnDeletion event, I added > TpmUndo(Item.Data).Free; > > I should know better, but I can't think of any other way to > handle the > memory being allocated for each undo object I'm adding to the > list. I know > that when you create something, you need to free it. I am > questioning if the > OnDeletion event is freeing that object's memory. So far I > dont have any > problems with this, but perhaps you can tell me if there is > still memory > leaks or perhaps a better way to add a TpmUndo object into the list? > __________________________________________________ > Delphi-Talk mailing list -> [email protected] > http://www.elists.org/mailman/listinfo/delphi-> talk > __________________________________________________ Delphi-Talk mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi-talk
