Quickreports memory leak - possible error in qrprntr.pas

I had an annoying memory leak using Quickreport v 3.5 with Delphi 5.
Every time I would print, a small amount of global memory remained

After beating my head against the wall for a few days, I stumbled upon
this solution. I don't know why it works, but it did remedy my
problem, and I post it here in the hopes it will reduce the agony and
frustration of my fellow QReport users...

in qrprntr.pas, modify the ResetDriver routine as follows:

{ TQRPrinter }

procedure ResetDriver(aPrinter : TPrinter);
  Device, Name, Port: array[0..255] of Char;
  DevMode: THandle;
  aPrinter.GetPrinter( Device, Name, Port , DevMode );
  aPrinter.SetPrinter( Device, Name, Port , 0 );

  GlobalUnlock(DevMode); //Add this line to fix memory leak

That's all. Happy computing.


Rick Brodner