mirror of https://gitlab.com/basile.b/dexed.git
fix a leak
This commit is contained in:
parent
e1cba9ae37
commit
bd4941dedb
|
@ -230,12 +230,12 @@ type
|
||||||
// allow to retrieve the breakpoints even if source is not openened.
|
// allow to retrieve the breakpoints even if source is not openened.
|
||||||
TPersistentBreakPoints = class(TWritableLfmTextComponent)
|
TPersistentBreakPoints = class(TWritableLfmTextComponent)
|
||||||
strict private
|
strict private
|
||||||
fItems: TOwnedCollection;
|
fItems: TCollection;
|
||||||
procedure setItems(value: TOwnedCollection);
|
procedure setItems(value: TCollection);
|
||||||
function getItem(index: integer): TPersistentBreakPoint;
|
function getItem(index: integer): TPersistentBreakPoint;
|
||||||
function find(const fname: string; line: integer; kind: TBreakPointKind): boolean;
|
function find(const fname: string; line: integer; kind: TBreakPointKind): boolean;
|
||||||
published
|
published
|
||||||
property items: TOwnedCollection read fItems write setItems;
|
property items: TCollection read fItems write setItems;
|
||||||
public
|
public
|
||||||
constructor create(aOwner: TComponent); override;
|
constructor create(aOwner: TComponent); override;
|
||||||
destructor destroy; override;
|
destructor destroy; override;
|
||||||
|
@ -637,7 +637,7 @@ var
|
||||||
fname: string;
|
fname: string;
|
||||||
begin
|
begin
|
||||||
Inherited;
|
Inherited;
|
||||||
fItems := TOwnedCollection.Create(self, TPersistentBreakPoint);
|
fItems := TCollection.Create(TPersistentBreakPoint);
|
||||||
fname := getCoeditDocPath + bpFname;
|
fname := getCoeditDocPath + bpFname;
|
||||||
if fname.fileExists then
|
if fname.fileExists then
|
||||||
loadFromFile(fname);
|
loadFromFile(fname);
|
||||||
|
@ -647,10 +647,11 @@ destructor TPersistentBreakPoints.destroy;
|
||||||
begin
|
begin
|
||||||
if fItems.Count > 0 then
|
if fItems.Count > 0 then
|
||||||
saveToFile(getCoeditDocPath + bpFname);
|
saveToFile(getCoeditDocPath + bpFname);
|
||||||
|
fItems.Free;
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPersistentBreakPoints.setItems(value: TOwnedCollection);
|
procedure TPersistentBreakPoints.setItems(value: TCollection);
|
||||||
begin
|
begin
|
||||||
fItems.Assign(value);
|
fItems.Assign(value);
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue