View Issue Details

IDProjectCategoryView StatusLast Update
0036853FPCRTLpublic2020-03-31 16:53
Reportergreenfil Assigned ToMarco van de Voort  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx64OSdebian 
Product Version3.0.4 
Summary0036853: fpg.TFPGMapObject free my object
Descriptionthe procedure TFPGMapObject.CopyData does not check the FreeObjects flag when deleting objects
Steps To Reproduceprogram Project1;
uses fgl;

type

  { TMyClass }

  TMyClass=class
    destructor Destroy; override;
  end;

  TMyClassMap=specialize TFPGMapObject<Integer, TMyClass>;


{ TMyClass }

destructor TMyClass.Destroy;
begin
  WriteLn('MyClass Destroy!');
  inherited Destroy;
end;

var MyClass:TMyClass; Map:TMyClassMap;
begin
  Map:=TMyClassMap.Create(False); //Not free MyObject!
  MyClass:=TMyClass.Create;
  Map.KeyData[0]:=MyClass;
  Map.KeyData[0]:=MyClass;//MyClass Destroy! WTF?!
  Map.Free;
end.
TagsNo tags attached.
Fixed in Revision44457
FPCOldBugId
FPCTarget-
Attached Files

Activities

Marco van de Voort

2020-03-31 16:53

manager   ~0121803

Fixed, thanks!

Issue History

Date Modified Username Field Change
2020-03-31 09:19 greenfil New Issue
2020-03-31 16:53 Marco van de Voort Assigned To => Marco van de Voort
2020-03-31 16:53 Marco van de Voort Status new => resolved
2020-03-31 16:53 Marco van de Voort Resolution open => fixed
2020-03-31 16:53 Marco van de Voort Fixed in Revision => 44457
2020-03-31 16:53 Marco van de Voort FPCTarget => -
2020-03-31 16:53 Marco van de Voort Note Added: 0121803