View Issue Details

IDProjectCategoryView StatusLast Update
0003073JEDI VCL00 JVCL Componentspublic2006-02-21 05:04
ReporteranonymousAssigned ToAHUser 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.30 
Summary0003073: memory leak in JvXPCheckBox
Descriptionmemory leaks when mouse passes over the JvXpCheckbox (about 4-12 bytes) or
when you check\uncheck it
TagsNo tags attached.

Activities

obones

2005-07-04 13:22

administrator   ~0007525

Please provide a trace of this happening, I can't see anything wrong in the code at first look.

anonymous

2005-07-05 03:00

viewer   ~0007526

try to place some XPcheckboxes on a clear form and run project
then look at the taskbar (project1.exe)
move mouse over XPcheckboxes (check and uncheck them)
look at the taskbar - project1.exe ocupies more and more memory
and when it ocupies about 30 Mb - project1.exe crash

waskol

2005-07-06 19:04

reporter   ~0007533

hmmm... seems to me that a bitmap is never calls its free method...

waskol

2005-07-07 04:12

reporter   ~0007535

Last edited: 2005-07-07 04:13

Have a look at the report ID n° 0001488 that you can find here :
homepages.borland.com/jedi/issuetracker/view.php?id=1488


There seems to have some problem with BrushCopy... (palette leak on 8bit pixel format, and so on...) ...and another one with dormant bitmaps.

Here is what i suggest :
in JVXPCoreUtils.pas, find :
procedure JvXPColorizeBitmap(Bitmap: TBitmap; const AColor: TColor);

...and comment out all the calls to Dormant and FreeImage methods, like this :

procedure JvXPColorizeBitmap(Bitmap: TBitmap; const AColor: TColor);
var
  ColorMap: TBitmap;
  Rect: TRect;
begin
  Rect := Bounds(0, 0, Bitmap.Width, Bitmap.Height);
  ColorMap := TBitmap.Create;
  try
    ColorMap.Assign(Bitmap);
    //Bitmap.Dormant;
    {$IFDEF VCL}
    //Bitmap.FreeImage;
    {$ENDIF VCL}
    with ColorMap.Canvas do
    begin
      Brush.Color := AColor;
      BrushCopy({$IFDEF VisualCLX} ColorMap.Canvas, {$ENDIF} Rect, Bitmap, Rect, clBlack);
    end;
    {$IFDEF VisualCLX}
    Bitmap.FreeImage;
    Bitmap.Assign(ColorMap);
    Bitmap.TransparentMode := tmAuto;
    {$ENDIF VisualCLX}
    {$IFDEF VCL}
    //Bitmap.ReleaseHandle;
    Bitmap.Assign(ColorMap);
    //ColorMap.Dormant;
    //ColorMap.FreeImage;
    //ColorMap.ReleaseHandle;
    {$ENDIF VCL}
  finally
    ColorMap.Free;
  end;
end;

What is surprising is that the problem was supposed to be solved !

waskol

2005-07-11 01:15

reporter   ~0007544

Please, could you consider issue solved and update changes to the CVS ? (not much work to do here ;) )

Thxs by advance.

François

2005-08-04 09:41

reporter   ~0007661

The problem still exist !!!!
My test on Win 98
A form with some JvXPCheckBox, it crash very fast when i move mouse over XPcheckboxes.

I comment the line :
//Bitmap.Dormant;
//Bitmap.FreeImage;
...



any other suggestions ?

AHUser

2006-02-21 05:04

developer   ~0008585

There is a bug in the VCL causing bitmaps loaded from a resource to leak. The JVCL has a work around for this for some time now.

Issue History

Date Modified Username Field Change
2005-07-03 21:21 anonymous New Issue
2005-07-04 13:22 obones Note Added: 0007525
2005-07-04 13:22 obones Status new => feedback
2005-07-05 03:00 anonymous Note Added: 0007526
2005-07-06 19:04 waskol Note Added: 0007533
2005-07-07 04:12 waskol Note Added: 0007535
2005-07-07 04:13 waskol Note Edited: 0007535
2005-07-07 04:13 waskol Note Edited: 0007535
2005-07-11 01:15 waskol Note Added: 0007544
2005-08-04 09:41 François Note Added: 0007661
2006-02-21 05:04 AHUser Status feedback => resolved
2006-02-21 05:04 AHUser Resolution open => fixed
2006-02-21 05:04 AHUser Assigned To => AHUser
2006-02-21 05:04 AHUser Note Added: 0008585