mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 19:59:31 +02:00
added TProject.Destroying
git-svn-id: trunk@4956 -
This commit is contained in:
parent
b70adfa95f
commit
dc9602f510
@ -234,6 +234,9 @@ var
|
|||||||
CustomOpts: TDefineTemplate;
|
CustomOpts: TDefineTemplate;
|
||||||
begin
|
begin
|
||||||
Result:=false; // no change
|
Result:=false; // no change
|
||||||
|
if ParentTemplate=nil then
|
||||||
|
RaiseException('UpdateCompilerOptionsTemplates internal error');
|
||||||
|
|
||||||
{ ToDo:
|
{ ToDo:
|
||||||
|
|
||||||
StackChecks
|
StackChecks
|
||||||
@ -376,6 +379,7 @@ var
|
|||||||
OldNode: TDefineTemplate;
|
OldNode: TDefineTemplate;
|
||||||
begin
|
begin
|
||||||
Result:=false; // no change
|
Result:=false; // no change
|
||||||
|
if ParentTemplate=nil then exit;
|
||||||
OldNode:=ParentTemplate.FindChildByName(Name);
|
OldNode:=ParentTemplate.FindChildByName(Name);
|
||||||
if OldNode<>nil then begin
|
if OldNode<>nil then begin
|
||||||
OldNode.Unbind;
|
OldNode.Unbind;
|
||||||
|
@ -288,7 +288,7 @@ type
|
|||||||
|
|
||||||
TEndUpdateProjectEvent =
|
TEndUpdateProjectEvent =
|
||||||
procedure(Sender: TObject; ProjectChanged: boolean) of object;
|
procedure(Sender: TObject; ProjectChanged: boolean) of object;
|
||||||
|
|
||||||
TProject = class(TObject)
|
TProject = class(TObject)
|
||||||
private
|
private
|
||||||
fActiveEditorIndexAtStart: integer;
|
fActiveEditorIndexAtStart: integer;
|
||||||
@ -302,6 +302,7 @@ type
|
|||||||
FFirstRequiredDependency: TPkgDependency;
|
FFirstRequiredDependency: TPkgDependency;
|
||||||
fFirst: array[TUnitInfoList] of TUnitInfo;
|
fFirst: array[TUnitInfoList] of TUnitInfo;
|
||||||
|
|
||||||
|
fDestroying: boolean;
|
||||||
FFlags: TProjectFlags;
|
FFlags: TProjectFlags;
|
||||||
fIconPath: String;
|
fIconPath: String;
|
||||||
fJumpHistory: TProjectJumpHistory;
|
fJumpHistory: TProjectJumpHistory;
|
||||||
@ -455,6 +456,7 @@ type
|
|||||||
property CompilerOptions: TProjectCompilerOptions
|
property CompilerOptions: TProjectCompilerOptions
|
||||||
read fCompilerOptions write fCompilerOptions;
|
read fCompilerOptions write fCompilerOptions;
|
||||||
property DefineTemplates: TProjectDefineTemplates read FDefineTemplates;
|
property DefineTemplates: TProjectDefineTemplates read FDefineTemplates;
|
||||||
|
property Destroying: boolean read fDestroying;
|
||||||
property FirstAutoRevertLockedUnit: TUnitInfo read GetFirstAutoRevertLockedUnit;
|
property FirstAutoRevertLockedUnit: TUnitInfo read GetFirstAutoRevertLockedUnit;
|
||||||
property FirstLoadedUnit: TUnitInfo read GetFirstLoadedUnit;
|
property FirstLoadedUnit: TUnitInfo read GetFirstLoadedUnit;
|
||||||
property FirstPartOfProject: TUnitInfo read GetFirstPartOfProject;
|
property FirstPartOfProject: TUnitInfo read GetFirstPartOfProject;
|
||||||
@ -1311,6 +1313,7 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
destructor TProject.Destroy;
|
destructor TProject.Destroy;
|
||||||
begin
|
begin
|
||||||
|
fDestroying:=true;
|
||||||
Clear;
|
Clear;
|
||||||
FreeThenNil(fBookmarks);
|
FreeThenNil(fBookmarks);
|
||||||
FreeThenNil(xmlconfig);
|
FreeThenNil(xmlconfig);
|
||||||
@ -2733,7 +2736,7 @@ procedure TProjectDefineTemplates.UpdateMain;
|
|||||||
begin
|
begin
|
||||||
// update the package block define template (the container for all other
|
// update the package block define template (the container for all other
|
||||||
// define templates of the package)
|
// define templates of the package)
|
||||||
if FMain=nil then begin
|
if (FMain=nil) and (not Owner.Destroying) then begin
|
||||||
// create the main project template
|
// create the main project template
|
||||||
FMain:=CreateProjectTemplate(FProjectDir);
|
FMain:=CreateProjectTemplate(FProjectDir);
|
||||||
FMain.SetDefineOwner(Owner,false);
|
FMain.SetDefineOwner(Owner,false);
|
||||||
@ -2749,8 +2752,10 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
Exclude(FFlags,ptfFlagsChanged);
|
Exclude(FFlags,ptfFlagsChanged);
|
||||||
|
if Owner.Destroying then exit;
|
||||||
if FMain=nil then UpdateMain;
|
if FMain=nil then UpdateMain;
|
||||||
|
|
||||||
|
if (FProjectDir=nil) then exit;
|
||||||
UpdateCompilerOptionsTemplates(FProjectDir,Owner.CompilerOptions,true,true);
|
UpdateCompilerOptionsTemplates(FProjectDir,Owner.CompilerOptions,true,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2784,6 +2789,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.145 2003/12/26 09:37:19 mattias
|
||||||
|
added TProject.Destroying
|
||||||
|
|
||||||
Revision 1.144 2003/12/25 14:17:06 mattias
|
Revision 1.144 2003/12/25 14:17:06 mattias
|
||||||
fixed many range check warnings
|
fixed many range check warnings
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user