Bläddra i källkod

heaptrace output on MacOS

Johann ELSASS 5 år sedan
förälder
incheckning
e054bc9aae
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4 1
      lazpaint/lazpaint.lpr

+ 4 - 1
lazpaint/lazpaint.lpr

@@ -151,6 +151,8 @@ end;
 {$R *.res}
 {$R *.res}
 
 
 {$IFDEF DARWIN}{$IFDEF DEBUG}
 {$IFDEF DARWIN}{$IFDEF DEBUG}
+const
+  ConsoleOutputFile = '/dev/ttys000';
 var
 var
   OldOutput: TextFile;
   OldOutput: TextFile;
 
 
@@ -158,7 +160,7 @@ var
   begin
   begin
     //on MacOS, you need to open the trerminal before running LazPaint
     //on MacOS, you need to open the trerminal before running LazPaint
     OldOutput := Output;
     OldOutput := Output;
-    AssignFile(Output, '/dev/ttys000');
+    AssignFile(Output, ConsoleOutputFile);
     Append(Output);
     Append(Output);
     Writeln;
     Writeln;
     Writeln('Debug started');
     Writeln('Debug started');
@@ -169,6 +171,7 @@ var
     Writeln('Debug ended');
     Writeln('Debug ended');
     CloseFile(Output);
     CloseFile(Output);
     Output := OldOutput;
     Output := OldOutput;
+    SetHeapTraceOutput(ConsoleOutputFile);
   end;
   end;
 {$ENDIF}{$ENDIF}
 {$ENDIF}{$ENDIF}