I have a TObjectList<TUSBDevice>, where TUSBDevice is a class I've made. I tried calling Delete with the index passed as a parameter but that it simply does what TList.Delete() does: removes the pointer from the list but doesn't free the object itself.
The breakpoint I placed on TUSBDevice.Destroy() doesn't break when Delete() is called. I also had a watch on the TObjectList and I can see the item gets removed from the list but the contents at the memory address of the object don't get freed.
Destructor of TUSBDevice:
destructor TUSBDevice.Destroy();
begin
removeDatabaseEntry();
filteredFolders.Free();
fileQueue.Free();
end;
TUSBDevicedestructor declaration withoverride:destructor Destroy; override;. Or your object list doesn't own its members. - Andreas Rejbrand