소스 검색

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

git-svn-id: trunk@26960 -
michael 11 년 전
부모
커밋
a1252febae
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  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;