diff --git a/tree/treeplayer/inc/ROOT/TDFNodes.hxx b/tree/treeplayer/inc/ROOT/TDFNodes.hxx index 6f33f8f8e4de5..d23ae7b9f85e6 100644 --- a/tree/treeplayer/inc/ROOT/TDFNodes.hxx +++ b/tree/treeplayer/inc/ROOT/TDFNodes.hxx @@ -137,6 +137,7 @@ public: void MakeProxy(TTreeReader &r, const std::string &bn) { + Reset(); bool useReaderValue = std::is_same::value; if (useReaderValue) fReaderValue.reset(new TTreeReaderValue(r, bn.c_str())); @@ -163,6 +164,14 @@ public: return std::array_view(fReaderArray->begin(), fReaderArray->end()); } + + void Reset() { + fReaderValue = nullptr; + fReaderArray = nullptr; + fValuePtr = nullptr; + fTmpColumn = nullptr; + fSlot = 0; + } }; template @@ -528,6 +537,7 @@ public: template void ROOT::Internal::TDataFrameValue::SetTmpColumn(unsigned int slot, ROOT::Detail::TDataFrameBranchBase *tmpColumn) { + Reset(); fTmpColumn = tmpColumn; if (tmpColumn->GetTypeId() != typeid(T)) throw std::runtime_error(std::string("TDataFrameValue: type specified is ") + typeid(T).name() +