Browse Source

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

git-svn-id: trunk@26960 -
michael 11 years ago
parent
commit
a1252febae
1 changed files with 6 additions and 2 deletions
  1. 6 2
      rtl/objpas/classes/collect.inc

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

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