From dc5819a6cd9956a6a827b7763f65de9d1cae92e3 Mon Sep 17 00:00:00 2001 From: gbamber Date: Fri, 20 Jan 2017 11:20:14 +0000 Subject: [PATCH] BugFix for TestApp git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5681 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../latest_stable/testapp/testapp.lpi | 8 +- .../latest_stable/testapp/testapp.lps | 84 +++++++++--------- .../latest_stable/testapp/testapp.res | Bin 139584 -> 139584 bytes .../latest_stable/testapp/umainform.pas | 17 +++- 4 files changed, 61 insertions(+), 48 deletions(-) diff --git a/components/lazautoupdate/latest_stable/testapp/testapp.lpi b/components/lazautoupdate/latest_stable/testapp/testapp.lpi index 84889eac0..32e8a5f10 100644 --- a/components/lazautoupdate/latest_stable/testapp/testapp.lpi +++ b/components/lazautoupdate/latest_stable/testapp/testapp.lpi @@ -19,10 +19,7 @@ - - - @@ -154,6 +151,11 @@ + + + + + diff --git a/components/lazautoupdate/latest_stable/testapp/testapp.lps b/components/lazautoupdate/latest_stable/testapp/testapp.lps index 8c9fc9be1..475fb1965 100644 --- a/components/lazautoupdate/latest_stable/testapp/testapp.lps +++ b/components/lazautoupdate/latest_stable/testapp/testapp.lps @@ -3,14 +3,14 @@ - + - - + + @@ -20,9 +20,9 @@ - - - + + + @@ -33,7 +33,7 @@ - + @@ -60,7 +60,7 @@ - + @@ -147,7 +147,7 @@ - + @@ -165,123 +165,123 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + diff --git a/components/lazautoupdate/latest_stable/testapp/testapp.res b/components/lazautoupdate/latest_stable/testapp/testapp.res index 1ef28c4df2ff92c037563e4ef255b8c56026a668..2feb20d57a5c3091f2e52171eb6749f3d47dde80 100644 GIT binary patch delta 47 wcmX?bh~vN^jtxiHSQ$WI^GP;kMqUF3Jq8dq1kueu+1r1zGj9LM&g3o$06?t_wg3PC delta 47 ucmX?bh~vN^jtxiHSQ#0BaPvtvWky~@20aEiZvM&M{*#??`%iWzcS!(2R1CZT diff --git a/components/lazautoupdate/latest_stable/testapp/umainform.pas b/components/lazautoupdate/latest_stable/testapp/umainform.pas index 9803865ed..d54cea71b 100644 --- a/components/lazautoupdate/latest_stable/testapp/umainform.pas +++ b/components/lazautoupdate/latest_stable/testapp/umainform.pas @@ -71,6 +71,7 @@ type private Logger: TEventLog; procedure WriteAndLog(szText: string); + procedure CloseLog; public end; @@ -83,6 +84,15 @@ implementation {$R *.lfm} { Tmainform } +procedure Tmainform.CloseLog; +begin + If Assigned(Logger) then + begin + Logger.Info('End of Log'); + Logger.Active:=False; + end; +end; + procedure Tmainform.WriteAndLog(szText: string); begin Logger.Info(szText); @@ -98,7 +108,6 @@ begin LazAutoUpdate1.GitHubBranchOrTag:='updates'; LazAutoUpdate1.ShowUpdateInCaption:=TRUE; Caption:=Application.Title; - If Assigned(Logger) then FreeAndNil(Logger); if FileExistsUTF8(C_LogFileName) then DeleteFile(C_LogFileName); Application.Processmessages; @@ -120,8 +129,8 @@ end; procedure Tmainform.FormDestroy(Sender: TObject); begin - If Assigned(Logger) then Logger.Info('End of Log'); - FreeAndNil(Logger); + CloseLog; + If Assigned(Logger) then FreeAndNil(Logger); end; procedure Tmainform.cmd_NewVersionAvailableClick(Sender: TObject); @@ -139,6 +148,7 @@ begin {$IFDEF DEBUGMODE} ShowMessage('Please do not try updating in DEBUG mode'); {$ELSE} + CloseLog; LazAutoUpdate1.UpdateToNewVersion; {$ENDIF} end; @@ -158,6 +168,7 @@ begin {$IFDEF DEBUGMODE} ShowMessage('Please do not try updating in DEBUG mode'); {$ELSE} + CloseLog; LazAutoUpdate1.AutoUpdate; {$ENDIF} end;