Explorar o código

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

git-svn-id: trunk@26960 -
michael %!s(int64=11) %!d(string=hai) anos
pai
achega
a1252febae
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  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;