mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 20:15:58 +02:00
LazLogger: Check the callback in a more thread save manner
git-svn-id: trunk@60265 -
This commit is contained in:
parent
131d04802a
commit
30146193bb
@ -711,6 +711,7 @@ end;
|
|||||||
procedure TLazLoggerFile.DoDbgOut(s: string);
|
procedure TLazLoggerFile.DoDbgOut(s: string);
|
||||||
var
|
var
|
||||||
Handled: Boolean;
|
Handled: Boolean;
|
||||||
|
CB: TLazLoggerWriteEvent;
|
||||||
begin
|
begin
|
||||||
if not IsInitialized then Init;
|
if not IsInitialized then Init;
|
||||||
|
|
||||||
@ -729,10 +730,11 @@ begin
|
|||||||
FDebugNestAtBOL := (s[length(s)] in [#10,#13]);
|
FDebugNestAtBOL := (s[length(s)] in [#10,#13]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if OnDbgOut <> nil then
|
CB := OnDbgOut;
|
||||||
|
if CB <> nil then
|
||||||
begin
|
begin
|
||||||
Handled := False;
|
Handled := False;
|
||||||
OnDbgOut(Self, s, Handled);
|
CB(Self, s, Handled);
|
||||||
if Handled then
|
if Handled then
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
@ -743,6 +745,7 @@ end;
|
|||||||
procedure TLazLoggerFile.DoDebugLn(s: string);
|
procedure TLazLoggerFile.DoDebugLn(s: string);
|
||||||
var
|
var
|
||||||
Handled: Boolean;
|
Handled: Boolean;
|
||||||
|
CB: TLazLoggerWriteEvent;
|
||||||
begin
|
begin
|
||||||
if not IsInitialized then Init;
|
if not IsInitialized then Init;
|
||||||
|
|
||||||
@ -753,10 +756,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
FDebugNestAtBOL := True;
|
FDebugNestAtBOL := True;
|
||||||
|
|
||||||
if OnDebugLn <> nil then
|
CB := OnDebugLn;
|
||||||
|
if CB <> nil then
|
||||||
begin
|
begin
|
||||||
Handled := False;
|
Handled := False;
|
||||||
OnDebugLn(Self, s, Handled);
|
CB(Self, s, Handled);
|
||||||
if Handled then
|
if Handled then
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user