about summary refs log tree commit diff stats
path: root/020run.cc
diff options
context:
space:
mode:
Diffstat (limited to '020run.cc')
-rw-r--r--020run.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/020run.cc b/020run.cc
index 362d93a0..e5bde518 100644
--- a/020run.cc
+++ b/020run.cc
@@ -176,7 +176,6 @@ if (!Run_tests && contains_key(Recipe_ordinal, "main") && contains_key(Recipe, g
   trace(9990, "run") << "=== Starting to run" << end();
   assert(Num_calls_to_transform_all == 1);
   run_main(argc, argv);
-  if (Trace_main) delete Trace_stream, Trace_stream = NULL;
   teardown();
 }
 :(code)
@@ -218,6 +217,7 @@ void cleanup_main() {
     fout << Trace_stream->readable_contents("");
     fout.close();
   }
+  if (Trace_stream) delete Trace_stream, Trace_stream = NULL;
 }
 :(before "End One-time Setup")
 atexit(cleanup_main);