-
- Downloads
IQA-463: LLError::addRecorder() claims ownership of passed Recorder*.
That is, when the underlying LLError::Settings object is destroyed -- possibly at termination, possibly on LLError::restoreSettings() -- the passed Recorder* is deleted. There was much existing code that seemed as unaware of this alarming fact as I was myself. Passing to addRecorder() a pointer to a stack object, or to a member of some other object, is just Bad. It might be preferable to make addRecorder() accept std::auto_ptr<Recorder> to make the ownership transfer more explicit -- or even boost::shared_ptr<Recorder> instead, which would allow the caller to either forget or retain the passed Recorder. This preliminary pass retains the Recorder* dumb pointer API, but documents the ownership issue, and eliminates known instances of passing pointers to anything but a standalone heap Recorder subclass object.
Showing
- indra/llcommon/llerrorcontrol.h 42 additions, 35 deletionsindra/llcommon/llerrorcontrol.h
- indra/llcommon/tests/llerror_test.cpp 116 additions, 110 deletionsindra/llcommon/tests/llerror_test.cpp
- indra/llcommon/tests/wrapllerrs.h 41 additions, 5 deletionsindra/llcommon/tests/wrapllerrs.h
- indra/test/test.cpp 7 additions, 3 deletionsindra/test/test.cpp
Loading
Please register or sign in to comment