hotspot/src/share/vm/compiler/compileLog.cpp
changeset 27709 e6f02d6fee44
parent 25715 d5a8dbdc5150
child 27883 3179632c8f66
--- a/hotspot/src/share/vm/compiler/compileLog.cpp	Thu Nov 13 09:19:46 2014 +0100
+++ b/hotspot/src/share/vm/compiler/compileLog.cpp	Wed Nov 26 08:06:58 2014 +0100
@@ -56,8 +56,10 @@
 }
 
 CompileLog::~CompileLog() {
-  delete _out;
+  delete _out; // Close fd in fileStream::~fileStream()
   _out = NULL;
+  // Remove partial file after merging in CompileLog::finish_log_on_error
+  unlink(_file);
   FREE_C_HEAP_ARRAY(char, _identities, mtCompiler);
   FREE_C_HEAP_ARRAY(char, _file, mtCompiler);
 }
@@ -278,10 +280,9 @@
       }
       file->print_raw_cr("</compilation_log>");
       close(partial_fd);
-      unlink(partial_file);
     }
     CompileLog* next_log = log->_next;
-    delete log;
+    delete log; // Removes partial file
     log = next_log;
   }
   _first = NULL;