mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 01:41:22 +02:00
fixed memleak in wsclasses
git-svn-id: trunk@5434 -
This commit is contained in:
parent
0ce0cd43a4
commit
0ad6281f00
@ -154,6 +154,18 @@ begin
|
||||
Node^.WSClass := AWSComponent;
|
||||
end;
|
||||
|
||||
procedure FreeRegistration;
|
||||
var
|
||||
Node: PClassNode;
|
||||
begin
|
||||
while (MComponentIndex.Count>0) do begin
|
||||
Node := PClassNode(MComponentIndex.Objects[MComponentIndex.Count-1]);
|
||||
Dispose(Node);
|
||||
MComponentIndex.Delete(MComponentIndex.Count-1);
|
||||
end;
|
||||
FreeAndNil(MComponentIndex);
|
||||
FreeAndNil(MWSRegisterIndex);
|
||||
end;
|
||||
|
||||
initialization
|
||||
MComponentIndex := TStringList.Create;
|
||||
@ -165,7 +177,6 @@ initialization
|
||||
MWSRegisterIndex.Duplicates := dupError;
|
||||
|
||||
finalization
|
||||
FreeAndNil(MComponentIndex);
|
||||
FreeAndNil(MWSRegisterIndex);
|
||||
|
||||
FreeRegistration;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user