File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
DataFormats/TestObjects/src Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 4848// related to SchemaEvolutionTestObjects.h
4949#ifndef DataFormats_TestObjects_USE_OLD
5050
51- // The following is from an example by Jakob Blomer from the ROOT team
51+ // The following is from an example from ROOT team
52+ // roottest/root/io/autoptr/TestAutoPtr_v3.hxx
5253namespace edmtest ::compat {
5354 template <typename T>
5455 struct deprecated_auto_ptr {
55- // We use compat_auto_ptr only to assign the wrapped raw pointer
56+ // We use deprecated_auto_ptr only to assign the wrapped raw pointer
5657 // to a unique pointer in an I/O customization rule.
57- // Therefore, we don't delete on destruction (because ownership
58- // gets transferred to the unique pointer).
58+ // However, since the deprecated_auto_ptr object can be reused, it is essential to always reset the
59+ // value after using it, so we can safely delete it (it should always be nullptr)
5960
60- // ~deprecated_auto_ptr() { delete _M_ptr; }
61+ ~deprecated_auto_ptr () { delete _M_ptr; }
6162
6263 T *_M_ptr = nullptr ;
6364 };
Original file line number Diff line number Diff line change @@ -418,7 +418,7 @@ exception when running testMissingDictionaryChecking_cfg.py.
418418 <ioread sourceClass =" std::auto_ptr<edmtest::SchemaEvolutionContained>" targetClass =" edmtest::compat::deprecated_auto_ptr<edmtest::SchemaEvolutionContained>" />
419419 <ioread sourceClass =" edmtest::SchemaEvolutionAutoPtrToUniquePtr" version =" [3]" targetClass =" edmtest::SchemaEvolutionAutoPtrToUniquePtr" source =" edmtest::compat::deprecated_auto_ptr<edmtest::SchemaEvolutionContained> contained_" target =" contained_" >
420420 <![CDATA[
421- contained_.release( ); contained_.reset( onfile.contained_._M_ptr) ;
421+ contained_.reset(onfile.contained_._M_ptr ); onfile.contained_._M_ptr = nullptr ;
422422 ]]>
423423 </ioread >
424424 <class name =" edmtest::SchemaEvolutionCArrayToStdArray" ClassVersion =" 4" >
You can’t perform that action at this time.
0 commit comments