Close files before delete.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Mar 2008 11:55:02 +0000 (11:55 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Mar 2008 11:55:02 +0000 (11:55 +0000)
STEER/AliMCEventHandler.cxx

index cf303c0..20f0072 100644 (file)
@@ -256,9 +256,9 @@ void AliMCEventHandler::ResetIO()
     delete fTreeE; fTreeE = 0;
 
 // Reset files
-    if (fFileE)  {delete fFileE;  fFileE  = 0;}
-    if (fFileK)  {delete fFileK;  fFileK  = 0;}
-    if (fFileTR) {delete fFileTR; fFileTR = 0;}
+    if (fFileE)  {fFileE->Close();  delete fFileE;  fFileE  = 0;}
+    if (fFileK)  {fFileK->Close();  delete fFileK;  fFileK  = 0;}
+    if (fFileTR) {fFileTR->Close(); delete fFileTR; fFileTR = 0;}
     fExtension="";
 }