diff options
author | Stinson Linden <stinson@lindenlab.com> | 2014-05-16 22:44:25 +0100 |
---|---|---|
committer | Stinson Linden <stinson@lindenlab.com> | 2014-05-16 22:44:25 +0100 |
commit | 34b2f2d1f841f7b7f93386d66be6943910cd055b (patch) | |
tree | f555da843edd3de150bcc91fa3e26bcca260455c /indra/llcommon/llerrorcontrol.h | |
parent | 76023f172c2a8eeb5c8d6b55119ef3e8faf8cc6f (diff) |
MAINT-4009: First pass refactoring to eliminate memory related to error reporting that is not properly cleaned up.
Diffstat (limited to 'indra/llcommon/llerrorcontrol.h')
-rwxr-xr-x | indra/llcommon/llerrorcontrol.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index aab695094c..681f444234 100755 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -30,6 +30,7 @@ #include "llerror.h" #include "boost/function.hpp" +#include "boost/shared_ptr.hpp" #include <string> class LLSD; @@ -156,16 +157,14 @@ namespace LLError mWantsFunctionName; }; + typedef boost::shared_ptr<Recorder> RecorderPtr; + /** - * @NOTE: addRecorder() conveys ownership to the underlying Settings - * object -- when destroyed, it will @em delete the passed Recorder*! - */ - LL_COMMON_API void addRecorder(Recorder*); - /** - * @NOTE: removeRecorder() reclaims ownership of the Recorder*: its - * lifespan becomes the caller's problem. + * @NOTE: addRecorder() and removeRecorder() uses the boost::shared_ptr to allow for shared ownership + * while still ensuring that the allocated memory is eventually freed */ - LL_COMMON_API void removeRecorder(Recorder*); + LL_COMMON_API void addRecorder(RecorderPtr); + LL_COMMON_API void removeRecorder(RecorderPtr); // each error message is passed to each recorder via recordMessage() LL_COMMON_API void logToFile(const std::string& filename); |