threadvars change location when a thread is started, use external variable

git-svn-id: trunk@6434 -
This commit is contained in:
micha 2004-12-30 14:46:54 +00:00
parent b62eab6b71
commit 8a7395aa69

View File

@ -222,6 +222,7 @@ implementation
var
InterfaceFinalizationHandlers: TList;
DebugTextAlloced: boolean;
DebugText: ^Text;
@ -813,6 +814,7 @@ begin
(DirectoryExists(ExtractFileDir(DebugFileName))) then begin
new(DebugText);
DebugTextAlloced := true;
Assign(DebugText^, DebugFileName);
if FileExists(DebugFileName) then
Append(DebugText^)
@ -825,14 +827,16 @@ begin
DebugText := nil
else
DebugText := @Output;
DebugTextAlloced := false;
end;
end;
procedure FinalizeDebugOutput;
begin
if Assigned(DebugText) and (DebugText<>@Output) then begin
if DebugTextAlloced then begin
Close(DebugText^);
Dispose(DebugText);
DebugTextAlloced := false;
end;
end;