FairRootGroup / FairRoot

C++ simulation, reconstruction and analysis framework for particle physics experiments
http://fairroot.gsi.de
Other
57 stars 96 forks source link

fix: Use TKey::ReadObject<T> instead of ReadObj #1461

Closed ChristianTackeGSI closed 10 months ago

ChristianTackeGSI commented 10 months ago

TKey::ReadObj returns an owning pointer. Using dynamic_cast and ignoring the "not castable" case can leak memory.

Also one std::unique_ptr

See: https://root-forum.cern.ch/t/possible-leak-with-dynamic-cast-and-tkey-readobj/56799 See: https://github.com/root-project/root/pull/13931


Checklist: