#1 2015-09-23 20:46:39

syagrius
Member
Registered: 2013-02-27
Posts: 13

LogView: Issue with TTimer

Hello,

I think I found an issue in project LogView.dpr of Sample 11 (Exception logging).

In procedure ReceivedOne() you try to Enable a timer using this line

procedure TMainLogView.ReceivedOne(const Text: RawUTF8);
begin
   // 8<----8<----8<----8<--
   tmrRefresh.Enabled := true; // MUCH faster than Synchronize() to use a timer
end;

But the timer event is not fired.
I think it's because you are not in situation where: GetCurrentThreadId = MainThreadId
                                                     
How to reproduce:
1 - Open and run LogView.dpr
2 - Click on [Server Launch]
3 - Test the connection using  RemoteLogginTest.dpr
4 - The event timer is not fired (or fired only once)

Tested under Delphi 2010/Win7x64

Offline

#2 2015-09-24 05:39:51

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: LogView: Issue with TTimer

It works here.
What is your configuration/target?

I've modified the implementation to ensure there is no threading issue.
See http://synopse.info/fossil/info/718e2821fd

Online

#3 2015-09-24 17:00:23

syagrius
Member
Registered: 2013-02-27
Posts: 13

Re: LogView: Issue with TTimer

Hi Arnaud,

I simply compile LogView.dpr Win32 VCL application with Delphi 2010/Windows 7x64.

And I got same issue compiling with Delphi 7.
Other «mORMothers» (I call it because they are mORMot Users - this make sense with my regional context) have same result on different computers.

This issue still remaining with the updated git repository (b010f9e6 - 2015-09-24 16:20).
I think the timer is never enabled now (or only once in procedure btnServerLaunchClick).

Last edited by syagrius (2015-09-24 17:01:20)

Offline

#4 2015-09-24 17:21:29

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: LogView: Issue with TTimer

I forgot to commit a source code line deletion.
See http://synopse.info/fossil/info/f520e9965e

Should work now.

Online

#5 2015-09-24 19:22:23

syagrius
Member
Registered: 2013-02-27
Posts: 13

Re: LogView: Issue with TTimer

RemoteLog is working now.
Thank you very much for you attendance and support.

Offline

Board footer

Powered by FluxBB