From 3169b10c11d05b3a4f2ab959e556c45cf3ad6120 Mon Sep 17 00:00:00 2001
From: Philippe Canal <pcanal@fnal.gov>
Date: Wed, 5 Jul 2006 17:29:05 +0000
Subject: [PATCH] Backward compatibility patch. Without this patch,
 TSelectorDraw can not longer detect parsing failure and in case of parsing
 failure would return 0 instead of -1. (as demonstrated by roottest failures
 in root/treeformula/array)

git-svn-id: http://root.cern.ch/svn/root/trunk@15710 27541ba8-7e3a-0410-8455-c3a389f83636
---
 treeplayer/src/TTreePlayer.cxx | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/treeplayer/src/TTreePlayer.cxx b/treeplayer/src/TTreePlayer.cxx
index d3e2e0d9e34..ac1698b4d9c 100644
--- a/treeplayer/src/TTreePlayer.cxx
+++ b/treeplayer/src/TTreePlayer.cxx
@@ -1,4 +1,4 @@
-// @(#)root/treeplayer:$Name:  $:$Id: TTreePlayer.cxx,v 1.218 2006/06/28 10:03:14 pcanal Exp $
+// @(#)root/treeplayer:$Name:  $:$Id: TTreePlayer.cxx,v 1.219 2006/07/04 23:35:37 rdm Exp $
 // Author: Rene Brun   12/01/96
 
 /*************************************************************************
@@ -2543,7 +2543,8 @@ Long64_t TTreePlayer::Process(TSelector *selector,Option_t *option, Long64_t nen
    if (gMonitoringWriter)
       gMonitoringWriter->SendProcessingStatus("STARTED",kTRUE);
 
-   if (selector->GetAbort() != TSelector::kAbortProcess) {
+   if (selector->GetAbort() != TSelector::kAbortProcess
+       && (selector->Version() != 0 || selector->GetStatus()!=-1)) {
 
       Long64_t readbytesatstart = 0;
       readbytesatstart = TFile::GetFileBytesRead();
@@ -2599,8 +2600,10 @@ Long64_t TTreePlayer::Process(TSelector *selector,Option_t *option, Long64_t nen
 
    }
 
-   selector->SlaveTerminate();   //<==call user termination function
-   selector->Terminate();        //<==call user termination function
+   if (selector->Version() != 0 || selector->GetStatus()!=-1) {
+     selector->SlaveTerminate();   //<==call user termination function
+     selector->Terminate();        //<==call user termination function
+   }
 
    if (gMonitoringWriter)
       gMonitoringWriter->SendProcessingStatus("DONE");
-- 
GitLab