Parcourir la source

* Make sure UpdateCount=0 when inherited destructor is called (and ooFree is dispatched (Bug ID 25821)

git-svn-id: trunk@26960 -
michael il y a 11 ans
Parent
commit
a1252febae
1 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. 6 2
      rtl/objpas/classes/collect.inc

+ 6 - 2
rtl/objpas/classes/collect.inc

@@ -302,8 +302,12 @@ end;
 
 
 destructor TCollection.Destroy;
 destructor TCollection.Destroy;
 begin
 begin
-  BeginUpdate; // Prevent OnChange
-  DoClear;
+  FUpdateCount:=1; // Prevent OnChange
+  try
+    DoClear;
+  Finally
+    FUpdateCount:=0;
+  end;
   FItems.Free;
   FItems.Free;
   Inherited Destroy;
   Inherited Destroy;
 end;
 end;