mirror of https://gitlab.com/basile.b/dexed.git
small fix for for #68, AV on runtime termination
This commit is contained in:
parent
3dcb9cad50
commit
0f99653d2c
|
@ -881,8 +881,6 @@ begin
|
||||||
fProjectGroup := getProjectGroup;
|
fProjectGroup := getProjectGroup;
|
||||||
//
|
//
|
||||||
getCMdParams;
|
getCMdParams;
|
||||||
if fNativeProject.isNil then
|
|
||||||
newNativeProj;
|
|
||||||
//
|
//
|
||||||
fInitialized := true;
|
fInitialized := true;
|
||||||
end;
|
end;
|
||||||
|
@ -1336,6 +1334,8 @@ begin
|
||||||
// see: http://forum.lazarus.freepascal.org/index.php/topic,30616.0.htm
|
// see: http://forum.lazarus.freepascal.org/index.php/topic,30616.0.htm
|
||||||
if fAppliOpts.reloadLastDocuments then
|
if fAppliOpts.reloadLastDocuments then
|
||||||
LoadLastDocsAndProj;
|
LoadLastDocsAndProj;
|
||||||
|
if fProjectInterface = nil then
|
||||||
|
newNativeProj;
|
||||||
|
|
||||||
DockMaster.ResetSplitters;
|
DockMaster.ResetSplitters;
|
||||||
|
|
||||||
|
@ -1398,8 +1398,11 @@ begin
|
||||||
(dlgFileChangeClose(fProjectInterface.filename) = mrCancel) then exit;
|
(dlgFileChangeClose(fProjectInterface.filename) = mrCancel) then exit;
|
||||||
for i := fMultidoc.documentCount-1 downto 0 do
|
for i := fMultidoc.documentCount-1 downto 0 do
|
||||||
if not fMultidoc.closeDocument(i) then exit;
|
if not fMultidoc.closeDocument(i) then exit;
|
||||||
|
if fProjectGroup.groupModified then if
|
||||||
|
(dlgFileChangeClose(fProjectGroup.groupFilename) = mrCancel) then exit;
|
||||||
canClose := true;
|
canClose := true;
|
||||||
closeProj;
|
closeProj;
|
||||||
|
fProjectGroup.closeGroup;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEMainForm.updateDocumentBasedAction(sender: TObject);
|
procedure TCEMainForm.updateDocumentBasedAction(sender: TObject);
|
||||||
|
@ -2636,10 +2639,12 @@ begin
|
||||||
if fProjectInterface = nil then exit;
|
if fProjectInterface = nil then exit;
|
||||||
//
|
//
|
||||||
if not fProjectInterface.inGroup then
|
if not fProjectInterface.inGroup then
|
||||||
|
begin
|
||||||
fProjectInterface.getProject.Free;
|
fProjectInterface.getProject.Free;
|
||||||
fProjectInterface := nil;
|
fProjectInterface := nil;
|
||||||
fNativeProject := nil;
|
fNativeProject := nil;
|
||||||
fDubProject := nil;
|
fDubProject := nil;
|
||||||
|
end;
|
||||||
showProjTitle;
|
showProjTitle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
|
@ -85,8 +85,7 @@ type
|
||||||
procedure btnRemProjClick(Sender: TObject);
|
procedure btnRemProjClick(Sender: TObject);
|
||||||
procedure lstProjDblClick(Sender: TObject);
|
procedure lstProjDblClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
fUngrouped: ICECommonProject;
|
fPrevProj: ICECommonProject;
|
||||||
fFromGroup: boolean;
|
|
||||||
fProjSubj: TCEProjectSubject;
|
fProjSubj: TCEProjectSubject;
|
||||||
//
|
//
|
||||||
procedure projNew(aProject: ICECommonProject);
|
procedure projNew(aProject: ICECommonProject);
|
||||||
|
@ -121,6 +120,7 @@ end;
|
||||||
|
|
||||||
destructor TProjectGroup.destroy;
|
destructor TProjectGroup.destroy;
|
||||||
begin
|
begin
|
||||||
|
fItems.Clear;
|
||||||
fItems.Free;
|
fItems.Free;
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
@ -279,6 +279,7 @@ destructor TProjectGroupItem.destroy;
|
||||||
begin
|
begin
|
||||||
if fProj <> nil then
|
if fProj <> nil then
|
||||||
fProj.getProject.free;
|
fProj.getProject.free;
|
||||||
|
fProj := nil;
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
@ -297,8 +298,8 @@ end;
|
||||||
|
|
||||||
destructor TCEProjectGroupWidget.destroy;
|
destructor TCEProjectGroupWidget.destroy;
|
||||||
begin
|
begin
|
||||||
inherited;
|
|
||||||
fProjSubj.free;
|
fProjSubj.free;
|
||||||
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEProjectGroupWidget.DoShow;
|
procedure TCEProjectGroupWidget.DoShow;
|
||||||
|
@ -311,8 +312,7 @@ end;
|
||||||
{$REGION Widget ICEProjectObserver ---------------------------------------------}
|
{$REGION Widget ICEProjectObserver ---------------------------------------------}
|
||||||
procedure TCEProjectGroupWidget.projNew(aProject: ICECommonProject);
|
procedure TCEProjectGroupWidget.projNew(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
if not fFromGroup then
|
fPrevProj := aProject;
|
||||||
fUngrouped := aProject;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEProjectGroupWidget.projChanged(aProject: ICECommonProject);
|
procedure TCEProjectGroupWidget.projChanged(aProject: ICECommonProject);
|
||||||
|
@ -322,14 +322,12 @@ end;
|
||||||
|
|
||||||
procedure TCEProjectGroupWidget.projClosing(aProject: ICECommonProject);
|
procedure TCEProjectGroupWidget.projClosing(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
if not fFromGroup then
|
fPrevProj := nil;
|
||||||
fUngrouped := nil;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEProjectGroupWidget.projFocused(aProject: ICECommonProject);
|
procedure TCEProjectGroupWidget.projFocused(aProject: ICECommonProject);
|
||||||
begin
|
begin
|
||||||
if not fFromGroup then
|
fPrevProj := aProject;
|
||||||
fUngrouped := aProject;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEProjectGroupWidget.projCompiling(aProject: ICECommonProject);
|
procedure TCEProjectGroupWidget.projCompiling(aProject: ICECommonProject);
|
||||||
|
@ -385,12 +383,12 @@ procedure TCEProjectGroupWidget.lstProjDblClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if lstProj.ItemIndex = -1 then
|
if lstProj.ItemIndex = -1 then
|
||||||
exit;
|
exit;
|
||||||
fFromGroup := true;
|
|
||||||
TProjectGroupItem(lstProj.Selected.Data).lazyLoad;
|
TProjectGroupItem(lstProj.Selected.Data).lazyLoad;
|
||||||
|
if fPrevProj <> nil then
|
||||||
|
subjProjClosing(fProjSubj, fPrevProj);
|
||||||
subjProjFocused(fProjSubj, TProjectGroupItem(lstProj.Selected.Data).project);
|
subjProjFocused(fProjSubj, TProjectGroupItem(lstProj.Selected.Data).project);
|
||||||
if projectGroup.index <> lstProj.ItemIndex then
|
if projectGroup.index <> lstProj.ItemIndex then
|
||||||
projectGroup.index := lstProj.ItemIndex;
|
projectGroup.index := lstProj.ItemIndex;
|
||||||
fFromGroup := false;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEProjectGroupWidget.handleChanged(sender: TObject);
|
procedure TCEProjectGroupWidget.handleChanged(sender: TObject);
|
||||||
|
|
Loading…
Reference in New Issue