LCL: TApplicationProperties: fixed removing events

git-svn-id: trunk@13399 -
This commit is contained in:
mattias 2007-12-20 11:52:42 +00:00
parent abdc5278c9
commit f8a3d56fcf

View File

@ -303,8 +303,21 @@ end;
destructor TApplicationProperties.Destroy;
begin
If not (csDesigning in ComponentState) then
Application.RemoveAllHandlersOfObject(Self);
If not (csDesigning in ComponentState) then begin
Application.RemoveOnExceptionHandler(FOnException);
Application.RemoveOnIdleHandler(FOnIdle);
Application.RemoveOnIdleEndHandler(FOnIdleEnd);
Application.RemoveOnEndSessionHandler(FOnEndSession);
Application.RemoveOnQueryEndSessionHandler(FOnQueryEndSession);
Application.RemoveOnMinimizeHandler(FOnMinimize);
Application.RemoveOnRestoreHandler(FOnRestore);
Application.RemoveOnDropFilesHandler(FOnDropFiles);
Application.RemoveOnHelpHandler(FOnHelp);
Application.RemoveOnHintHandler(FOnHint);
Application.RemoveOnShowHintHandler(FOnShowHint);
Application.RemoveOnUserInputHandler(FOnUserInput);
end;
//AG Application.RemoveAllHandlersOfObject(Self); "Self" is wrong, because Events is owner's methods
inherited Destroy;
end;