[fpc-pascal] TObjectList works; TFPObjectList gives memory leaks

Jim hakkie42 at gmail.com
Sun Aug 1 14:00:53 CEST 2010


Hi all,

Still working on my file indexer:
http://bitbucket.org/jb/flocate/changeset/6c6fa90e632e

Each search for files creates a TObjectList descendant
(TDirectoryEntryList, see directoryentrylist.pp)

On finding a file, the search class createa a DirectoryEntry object with
the relevant file properties and adds this to the directoryentrylist.

Finally, I iterate through the list and store the results in a database.
Then I try to destroy the directoryentrylist, and the directoryentry
items get deleted by the Tobjectlist code.

This works using a TObjectList; however when I use a TFPObjectList for
TDirectoryEntryList, I have a memory leak of exactly all files/objects
found that were not released.
(This is in FPC 2.5.1/Win32)

Am I missing something here? The documentation suggests that TObjectList
and TFPObjectlist only differ in some notification stuff...

Thanks,

-- 
Regards,

jb



More information about the fpc-pascal mailing list