소스 검색

* Fix from Luiz Americo to avoid crash when a freenotification is registered during destroy. (bug ID 23031)

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

+ 5 - 10
rtl/objpas/classes/compon.inc

@@ -559,17 +559,12 @@ Procedure TComponent.FreeNotification(AComponent: TComponent);
 
 begin
   If (Owner<>Nil) and (AComponent=Owner) then exit;
-  if csDestroying in ComponentState then
-    AComponent.Notification(Self,opRemove)
-  else
+  If not (Assigned(FFreeNotifies)) then
+    FFreeNotifies:=TFpList.Create;
+  If FFreeNotifies.IndexOf(AComponent)=-1 then
     begin
-    If not (Assigned(FFreeNotifies)) then
-      FFreeNotifies:=TFpList.Create;
-    If FFreeNotifies.IndexOf(AComponent)=-1 then
-      begin
-      FFreeNotifies.Add(AComponent);
-      AComponent.FreeNotification (self);
-      end;
+    FFreeNotifies.Add(AComponent);
+    AComponent.FreeNotification (self);
     end;
 end;