Skip to content

Commit

Permalink
Fixes the memory handling of the DetailObjects list
Browse files Browse the repository at this point in the history
  • Loading branch information
jfudickar committed Aug 17, 2023
1 parent 06dd32b commit 2e3263d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions source/json2pumlpuml.pas
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ tPumlCharacteristicList = class(tBasePumlStringList)

tPumlDetailObjectList = class(tBasePumlStringList)
public
constructor Create(iParentObject: tBasePumlObject); override;
procedure GeneratePumlClassList (ipuml: TStrings);
procedure GeneratePumlTogether (ipuml: TStrings; iParentObjectName, iParentObjectTitle: string);
end;
Expand Down Expand Up @@ -446,7 +447,7 @@ implementation

uses
System.SysUtils,
System.Generics.Collections, System.Types, System.IOUtils, json2pumltools, System.Variants;
System.Generics.Collections, System.Types, System.IOUtils, json2pumltools, System.Variants, json2pumlloghandler;

constructor tPumlObjectList.Create;
begin
Expand Down Expand Up @@ -538,8 +539,6 @@ constructor tPumlObject.Create;
FCharacteristics := tPumlCharacteristicList.Create (Self);
FRelations := tPumlObjectRelationshipList.Create (Self);
FDetailObjects := tPumlDetailObjectList.Create (Self);
FDetailObjects.Sorted := true;
FDetailObjects.Duplicates := dupIgnore;
FIsObjectDetail := False;
FIsRelationship := False;
FFiltered := true;
Expand Down Expand Up @@ -1457,6 +1456,14 @@ procedure tBasePumlStringList.UpdateRedundant;
tBasePumlObject (Objects[i]).UpdateRedundant;
end;

constructor tPumlDetailObjectList.Create(iParentObject: tBasePumlObject);
begin
inherited Create(iParentObject);
Sorted := true;
Duplicates := dupIgnore;
OwnsObjects := False;
end;

procedure tPumlDetailObjectList.GeneratePumlClassList (ipuml: TStrings);
var
i: Integer;
Expand Down

0 comments on commit 2e3263d

Please sign in to comment.