summaryrefslogtreecommitdiff
path: root/include/utils/RefBase.h
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2011-06-06 15:21:44 -0700
committer Android Git Automerger <android-git-automerger@android.com> 2011-06-06 15:21:44 -0700
commitc1cbf4525b4d12b6cb7908072d36c8f6ca819f5b (patch)
treece173c0b5701869e56fb967aa76185b4ab592131 /include/utils/RefBase.h
parente9d32283e4eca1ee27218ed66f754a694678ac6d (diff)
parent24855c09173a6caaec7dcedd0c2d7ce15121d39b (diff)
am 24855c09: merge various SF fixes from gingerbread to honeycomb-mr2 (DO NOT MERGE)
* commit '24855c09173a6caaec7dcedd0c2d7ce15121d39b': merge various SF fixes from gingerbread to honeycomb-mr2 (DO NOT MERGE)
Diffstat (limited to 'include/utils/RefBase.h')
-rw-r--r--include/utils/RefBase.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/utils/RefBase.h b/include/utils/RefBase.h
index f3550877133f..e88cb29b7f99 100644
--- a/include/utils/RefBase.h
+++ b/include/utils/RefBase.h
@@ -120,7 +120,14 @@ public:
protected:
RefBase();
virtual ~RefBase();
-
+
+ // called when the last reference goes away. this is responsible for
+ // calling the destructor. The default implementation just does
+ // "delete this;".
+ // Make sure to never acquire a strong reference from this function. The
+ // same restrictions than for destructors apply.
+ virtual void destroy() const;
+
//! Flags for extendObjectLifetime()
enum {
OBJECT_LIFETIME_WEAK = 0x0001,