소스 검색

* Fix bug ID #21458

git-svn-id: trunk@35607 -
michael 8 년 전
부모
커밋
c213a4187a
1개의 변경된 파일13개의 추가작업 그리고 12개의 파일을 삭제
  1. 13 12
      rtl/objpas/classes/compon.inc

+ 13 - 12
rtl/objpas/classes/compon.inc

@@ -291,21 +291,22 @@ end;
 Procedure TComponent.Notification(AComponent: TComponent;
   Operation: TOperation);
 
-Var Runner : Longint;
+Var 
+  C : Longint;
 
 begin
-  If (Operation=opRemove) and Assigned(FFreeNotifies) then
+  If (Operation=opRemove) then
+    RemoveFreeNotification(AComponent);
+  If Not assigned(FComponents) then
+    exit;
+  C:=FComponents.Count-1;
+  While (C>=0) do
     begin
-    FFreeNotifies.Remove(AComponent);
-            If FFreeNotifies.Count=0 then
-      begin
-      FFreeNotifies.Free;
-      FFreenotifies:=Nil;
-      end;
-    end;
-  If assigned(FComponents) then
-    For Runner:=0 To FComponents.Count-1 do
-      TComponent(FComponents.Items[Runner]).Notification(AComponent,Operation);
+    TComponent(FComponents.Items[C]).Notification(AComponent,Operation);
+    Dec(C);
+    if C>=FComponents.Count then
+      C:=FComponents.Count-1;
+    end;  
 end;