Browse Source

* Correctly free objects when destroying stringlist instance

git-svn-id: trunk@20265 -
michael 13 years ago
parent
commit
723482c814
1 changed files with 1 additions and 4 deletions
  1. 1 4
      rtl/objpas/classes/stringl.inc

+ 1 - 4
rtl/objpas/classes/stringl.inc

@@ -1133,10 +1133,7 @@ Var I : Longint;
 begin
 begin
   FOnChange:=Nil;
   FOnChange:=Nil;
   FOnChanging:=Nil;
   FOnChanging:=Nil;
-  // This will force a dereference. Can be done better...
-  For I:=0 to FCount-1 do
-    FList^[I].FString:='';
-  FCount:=0;
+  Clear;
   SetCapacity(0);
   SetCapacity(0);
   Inherited destroy;
   Inherited destroy;
 end;
 end;