From b0448f6f30d4189678ed19995ac2807631199fa9 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 13 Feb 2014 23:19:30 +0000 Subject: [PATCH] IDE: TProjectIcon: do not set icon twice when loading git-svn-id: branches/fixes_1_2@44060 - --- ide/projecticon.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ide/projecticon.pas b/ide/projecticon.pas index 131d0d6f9c..5c92ea4a6e 100644 --- a/ide/projecticon.pas +++ b/ide/projecticon.pas @@ -177,6 +177,7 @@ var begin Result := False; if IsEmpty then exit; + //debugln(['TProjectIcon.CreateIconFile ',FIcoFileName]); try if FileExistsUTF8(FIcoFileName) then fs:=TFileStreamUTF8.Create(FIcoFileName,fmOpenWrite) @@ -207,6 +208,7 @@ procedure TProjectIcon.SetIsEmpty(const AValue: Boolean); var NewData: TIconData; fs: TFileStreamUTF8; + ok: Boolean; begin if IsEmpty=AValue then exit; if AValue then @@ -214,7 +216,7 @@ begin else begin // We need to restore data from the .ico file - IconData := nil; + ok:=false; try fs:=TFileStreamUTF8.Create(FIcoFileName,fmOpenRead); try @@ -222,11 +224,14 @@ begin if length(NewData)>0 then fs.Read(NewData[0],length(NewData)); IconData := NewData; + ok:=true; finally fs.Free end; except end; + if not ok then + IconData:=nil; end; Modified := True; end;