aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJohannes Schickel2008-07-29 09:16:53 +0000
committerJohannes Schickel2008-07-29 09:16:53 +0000
commit290f76a62352e741acd5888574cb30831c39da5d (patch)
treeb1c8a20c7fc5c199f741e8eac623e6918ec4fb1b /common
parent598394e5b88f8513b9f5d9ee841e5bc2882f5d6c (diff)
downloadscummvm-rg350-290f76a62352e741acd5888574cb30831c39da5d.tar.gz
scummvm-rg350-290f76a62352e741acd5888574cb30831c39da5d.tar.bz2
scummvm-rg350-290f76a62352e741acd5888574cb30831c39da5d.zip
Added a reset method to SharedPtr, which allows NULLifying it.
svn-id: r33400
Diffstat (limited to 'common')
-rw-r--r--common/ptr.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/ptr.h b/common/ptr.h
index eea3c39882..9879db28a6 100644
--- a/common/ptr.h
+++ b/common/ptr.h
@@ -171,6 +171,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.
*/