#1 2015-04-10 08:12:30

Amir
Member
From: UAE
Registered: 2010-08-17
Posts: 36

About the ticket [ca41b5d79a], as you (ab) requested.

Hi dear Arnaud,

In the following code snippet:

destructor TSQLHTTPRestServer.Destroy;
begin
  fLog.Enter(Self).Log...  // the rest of the code line.
  {the rest of the destructor routine}
end;

when this destructor is called with {$define WITHLOG}, everything goes right and it works like a charm, but if we do compile with "WITHLOG" directive undefined, an AV occurs when the destructor is called.

Seems the "fLog" field in above code snippet is not instanciated, as it may not being used by any other means of the framework. I think that code-line above should be surrounded with a {ifdef WITHLOG}{endif} pair - like many other parts of your code - to prevet this issue.

To reproduce this issue you can compile the Client/Server official example with "WITHLOG" undefined.

I think it is a simple and small regression which remained hidden as the most of times we all compile our code with {define WITHLOG}.
And please excuse me for that unclear ticket, I should have explained more. Actually I created the ticket in a situation that I was very in a hurry.

Thanks.

Last edited by Amir (2015-04-12 04:08:56)


Amir

Offline

#2 2015-04-12 10:38:47

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

Re: About the ticket [ca41b5d79a], as you (ab) requested.

Should be fixed by http://synopse.info/fossil/info/b3451bc24e

IMHO there is NO benefit of undefining WITHLOG.
The performance change would be imperceptible.
If logging is not enabled, all the log methods would be almost a no-operation (just a function call with immediate exit).

So we advance to let WITHLOG defined in all cases, as it is stated in Synopse.inc comments.

Offline

#3 2015-04-12 19:08:33

Amir
Member
From: UAE
Registered: 2010-08-17
Posts: 36

Re: About the ticket [ca41b5d79a], as you (ab) requested.

Yes,
I was just testing all different aspects of the mORMot framework for better understanding of myself from its operations, I ran the tests in both logging enabled and disabled states, and as always you're right, almost no performance difference !!! Great work by all means.
Thanks.


Amir

Offline

Board footer

Powered by FluxBB