DragDrop0400 memory leak



I started using the Drag & drop component suite 4.00
by Anders Melander which works fine.

However, I also use FastMM4 which reports a memory leak
for each drag operation. The report looks like this

-----------------------------------------------------------
A memory block has been leaked. The size is: 20

Stack trace of when this block was allocated (return addresses):
4029CF [System][@GetMem]
403907 [System][TObject.NewInstance]
403CCE [System][@ClassCreate]
479AAE [DragDrop.pas][DragDrop][TClipboardFormats.Create][905]
403910 [System][TObject.NewInstance]
4653F7 [DropSource.pas][DropSource][TEnumFormatEtc.Create][960]
465A58 [DropSource.pas][DropSource][TCustomDropMultiSource.GetEnumFormatEtc][1166]
464ABB [DropSource.pas][DropSource][TCustomDropSource.EnumFormatEtc][480]
775334F5 [OleUninitialize]

The block is currently used for an object of class: TClipboardFormats

-----------------------------------------------------------

Now looking at the source, I found that the TEnumFormatEtc
class has a field "FFormats" of type TClipboardFormats which is
created by the constructor, but there is no Destroy method for
that class.

It seems that simply adding the following destructor

destructor TEnumFormatEtc.Destroy;
begin
FFormats.Free;
inherited;
end;

patches the leak but I'm not sure at all of what I'm doing because TEnumFormatEtc is declared as:

TEnumFormatEtc = class(TInterfacedObject, IEnumFormatEtc)
...
end;

and I never play with interfaces.

Anybody can confirm that what I'm doing is ok?

TIA,
Jacques

.



Relevant Pages

  • [ANN] Mongrel 0.3.13.4 Pre-Release -- Rubys LEAK Fixed (Death To Mutex!)
    ... This release is after painstaking analysis of a memory leak that was ... Those two scripts are mini versions of how Mongrel manages threads so ... Rails impacts your application, or what is causing BAD CLIENT then just ... What you want to do is adjust num-conns and rate until Mongrel reports ...
    (comp.lang.ruby)
  • Re: Cant drag word find box
    ... I believe John's point was that there haven't been any similar reports ... That's the only part you can drag. ... Since my recent auto update, I can no longer drag or move the Word find box ... John McGhie, Microsoft MVP, Consultant Technical Writer, ...
    (microsoft.public.mac.office.word)
  • Re: QC report 5750 analysis - 50% of success
    ... marks reports from a main list for 5750 ... 2714 Midas, Changing a value in a filtered CDS where ... ... 3951 IDE, Access Violation at shutdown ... 3636+ TInvokableClass memory leak ...
    (borland.public.delphi.non-technical)
  • RE: Excel gets slower and slower....
    ... This does not have to be a memory leak; are all the reports open at the same ... edits any cells it may be recalculating all the open workbooks. ... to see if you are closing down Excel completely (might show multiple hidden ...
    (microsoft.public.excel.programming)
  • Re: memory problem
    ... I'm pretty sure I have some kind of memory leak. ... total used free shared buffers cached ... Swap: 2040244 1652 2038592 ...
    (Fedora)