Explorar el Código

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

git-svn-id: trunk@26960 -
michael hace 11 años
padre
commit
a1252febae
Se han modificado 1 ficheros con 6 adiciones y 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;