fix, the sub project was created twice, leading to a leak + AV when terminating CE

This commit is contained in:
Basile Burg 2015-09-20 00:00:52 +02:00
parent 04d7308bf7
commit 94f34b3f88
1 changed files with 6 additions and 5 deletions

View File

@ -160,6 +160,12 @@ begin
{$ELSE}
pth := GetEnvironmentVariable('HOME') + '/.dub/packages/' + nme + '-master';
{$ENDIF}
itf := getMessageDisplay;
if DirectoryExists(pth) then
begin
itf.message('the dub package is already fetched', nil, amcApp, amkInf);
exit;
end;
// fetch
dub := TProcess.Create(nil);
@ -177,7 +183,6 @@ begin
str := TStringList.Create;
try
processOutputToStrings(dub, str);
itf := getMessageDisplay;
for msg in str do
itf.message(msg, nil, amcMisc, amkAuto);
finally
@ -206,7 +211,6 @@ begin
str := TStringList.Create;
try
processOutputToStrings(dub, str);
itf := getMessageDisplay;
for msg in str do
itf.message(msg, nil, amcMisc, amkAuto);
finally
@ -221,13 +225,10 @@ begin
exit;
end;
// TODO-cbugfix: entity connector, AV when CE terminates due to the begin/end update trick.
// project used to get the infos
EntitiesConnector.beginUpdate;
prj := TCEDubProject.create(nil);
EntitiesConnector.removeSubject(prj);
try
prj := TCEDubProject.create(nil);
if FileExists(pth + DirectorySeparator + 'dub.json') then
prj.loadFromFile(pth + DirectorySeparator + 'dub.json')
else if FileExists(pth + DirectorySeparator + 'package.json') then