mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 19:08:03 +02:00
TApplication now frees only its components before finalization, not itself
git-svn-id: trunk@6860 -
This commit is contained in:
parent
374bd2d809
commit
1fe900aedb
16
ide/main.pp
16
ide/main.pp
@ -446,6 +446,8 @@ type
|
||||
protected
|
||||
procedure SetToolStatus(const AValue: TIDEToolStatus); override;
|
||||
function DoResetToolStatus(Interactive: boolean): boolean;
|
||||
procedure Notification(AComponent: TComponent;
|
||||
Operation: TOperation); override;
|
||||
|
||||
procedure ToolButtonClick(Sender: TObject);
|
||||
procedure OnApplyWindowLayout(ALayout: TIDEWindowLayout);
|
||||
@ -1051,6 +1053,8 @@ begin
|
||||
|
||||
// free IDE parts
|
||||
FreeFormEditor;
|
||||
FreeAndNil(FindReplaceDlg);
|
||||
FreeAndNil(MessagesView);
|
||||
FreeThenNil(AnchorDesigner);
|
||||
FreeThenNil(ObjectInspector1);
|
||||
FreeThenNil(GlobalDesignHook);
|
||||
@ -1082,8 +1086,8 @@ end;
|
||||
|
||||
procedure TMainIDE.CreateOftenUsedForms;
|
||||
begin
|
||||
Application.CreateForm(TMessagesView, MessagesView);
|
||||
Application.CreateForm(TLazFindReplaceDialog, FindReplaceDlg);
|
||||
MessagesView:=TMessagesView.Create(nil);
|
||||
FindReplaceDlg:=TLazFindReplaceDialog.Create(nil);
|
||||
end;
|
||||
|
||||
procedure TMainIDE.CreateSearchResultWindow;
|
||||
@ -2486,6 +2490,11 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.Notification(AComponent: TComponent; Operation: TOperation);
|
||||
begin
|
||||
inherited Notification(AComponent, Operation);
|
||||
end;
|
||||
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
|
||||
@ -11409,6 +11418,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.849 2005/02/28 16:52:24 mattias
|
||||
TApplication now frees only its components before finalization, not itself
|
||||
|
||||
Revision 1.848 2005/02/25 21:55:44 mattias
|
||||
added filter for open package/project/file
|
||||
|
||||
|
@ -4277,6 +4277,7 @@ begin
|
||||
// some action has changed the cursor during incremental search
|
||||
// -> end incremental search
|
||||
EndIncrementalFind;
|
||||
// this called UpdateStatusBar -> exit
|
||||
exit;
|
||||
end;
|
||||
|
||||
|
@ -942,6 +942,7 @@ type
|
||||
procedure DoIdleActions;
|
||||
procedure MenuPopupHandler(Sender: TObject);
|
||||
procedure DoFreeReleaseComponents;
|
||||
procedure DoBeforeFinalization;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -1284,7 +1285,7 @@ end;
|
||||
procedure BeforeFinalization;
|
||||
// This is our ExitProc handler.
|
||||
begin
|
||||
FreeInterfaceObject;
|
||||
Application.DoBeforeFinalization;
|
||||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -96,6 +96,7 @@ begin
|
||||
|
||||
inherited Create(AOwner);
|
||||
CaptureExceptions:=true;
|
||||
|
||||
FOldExitProc:=ExitProc;
|
||||
ExitProc:=@BeforeFinalization;
|
||||
end;
|
||||
@ -186,6 +187,12 @@ begin
|
||||
FMainForm:= nil;
|
||||
Terminate;
|
||||
end;
|
||||
if AComponent=FHintWindow then begin
|
||||
FHintWindow:=nil;
|
||||
end;
|
||||
if AComponent=FHintTimer then begin
|
||||
FHintTimer:=nil;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -743,6 +750,17 @@ begin
|
||||
FreeThenNil(FReleaseComponents);
|
||||
end;
|
||||
|
||||
procedure TApplication.DoBeforeFinalization;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
if Self=nil then exit;
|
||||
for i:=ComponentCount-1 downto 0 do begin
|
||||
//debugln('TApplication.DoBeforeFinalization ',DbgSName(Components[i]));
|
||||
if i<ComponentCount then Components[i].Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TApplication.IconChanged
|
||||
------------------------------------------------------------------------------}
|
||||
@ -1418,6 +1436,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.105 2005/02/28 16:52:24 mattias
|
||||
TApplication now frees only its components before finalization, not itself
|
||||
|
||||
Revision 1.104 2005/02/26 20:43:54 mattias
|
||||
TApplication now uses ExitProc to free itself before all finaizations
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user