From 290f76a62352e741acd5888574cb30831c39da5d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 29 Jul 2008 09:16:53 +0000 Subject: Added a reset method to SharedPtr, which allows NULLifying it. svn-id: r33400 --- common/ptr.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'common') diff --git a/common/ptr.h b/common/ptr.h index eea3c39882..9879db28a6 100644 --- a/common/ptr.h +++ b/common/ptr.h @@ -170,6 +170,16 @@ public: */ bool unique() const { return refCount() == 1; } + /** + * Resets the SharedPtr object to a NULL pointer. + */ + void reset() { + decRef(); + _deletion = 0; + _refCount = 0; + _pointer = 0; + } + /** * Returns the number of references to the assigned pointer. * This should just be used for debugging purposes. -- cgit v1.2.3