diff options
author | Mathias Agopian <mathias@google.com> | 2011-05-19 19:41:37 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-05-19 19:41:37 -0700 |
commit | 16fa5aae96ec7bb0ecf1578197b64d477bb6946e (patch) | |
tree | fb7f8f56eb4984f404c30efa434c34495e9da66a /include | |
parent | e219b5452c20b069b25109a8bedca8d37ec3ccb6 (diff) | |
parent | 6db8c505398a0979853f6c166e0a8bcafd9268f8 (diff) | |
download | frameworks_base-16fa5aae96ec7bb0ecf1578197b64d477bb6946e.zip frameworks_base-16fa5aae96ec7bb0ecf1578197b64d477bb6946e.tar.gz frameworks_base-16fa5aae96ec7bb0ecf1578197b64d477bb6946e.tar.bz2 |
Merge "RefBase subclasses can now decide how they want to be destroyed."
Diffstat (limited to 'include')
-rw-r--r-- | include/utils/RefBase.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/utils/RefBase.h b/include/utils/RefBase.h index f355087..4126225 100644 --- a/include/utils/RefBase.h +++ b/include/utils/RefBase.h @@ -51,7 +51,6 @@ inline bool operator _op_ (const U* o) const { \ } // --------------------------------------------------------------------------- - class ReferenceMover; class ReferenceConverterBase { public: @@ -120,7 +119,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, |