D4 - TBitmap.Dormant doesn't work !!!

Hi,

I tried compile a project from D2 in D4. It was very strange for me
that project compiled in D4 uses a lot of GDI resources, comparing with
D2. So, I use Memory Sleuth and found the problem.

Each component which has a Glyph property allocates one Bitmap
handle !!!!!! Imagine, u have 10 TDBNavigators in your project,
each TDBNavigator has 10 glyph images, so your app keeps 100
bitmap handles (D2 only 3 handles)! Problem is in TBitmap.Dormant
method. It doesn't release bitmap handle.

help says:

procedure Dormant;

Creates a memory bitmap image in order to release the bitmap handle and save
resources.

Use Dormant to reduce the amount of GDI resources used by the application.
Dormant creates a bitmap image in memory using a memory stream object. This
preserves the image so that the bitmap can then free the HBITMAP (accessed
through the Handle property) that was assigned to it.

....but source code - Delphi 4, Graphics :

  TSharedImage = class
  private
    FRefCount: Integer;
  protected
    procedure Reference;
    procedure Release;
    procedure FreeHandle; virtual; abstract;
    property RefCount: Integer read FRefCount;
  end;

  ^^^^^^ Where is the "memory stream object" ?

procedure TBitmap.Dormant;
begin
  FreeContext;
  DIBNeeded;  <- There is NO memory stream saving ...
  FImage.FreeHandle;
end;

and compare it with Delphi 2, Graphics:

  TInternalImage = class
  private
    FRefCount: Integer;
    FMemoryImage: TCustomMemoryStream;
    procedure Reference;
    procedure Release;
    procedure FreeHandle; virtual; abstract;
  end;

procedure TBitmap.Dormant;
begin
  MemoryImageNeeded; // Yes, there is memory stream saving ...
  FImage.FreeHandle;
end;

Petr.