summaryrefslogtreecommitdiffstats
path: root/include/utils/RefBase.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-06-13 14:13:21 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-06-13 14:13:21 -0700
commit77079399fca3e9c71e2ac06f3da26934e1c278b9 (patch)
tree5a87f9e9d6f09afb81e9f4da952be5ff2b391af0 /include/utils/RefBase.h
parentfc441bfff9eb68be08eb922ea05c78c5d6fba27a (diff)
parenta9c9a4baf24700e8817d47d8ea8da1742caea0b5 (diff)
downloadframeworks_base-77079399fca3e9c71e2ac06f3da26934e1c278b9.zip
frameworks_base-77079399fca3e9c71e2ac06f3da26934e1c278b9.tar.gz
frameworks_base-77079399fca3e9c71e2ac06f3da26934e1c278b9.tar.bz2
am a9c9a4ba: fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
* commit 'a9c9a4baf24700e8817d47d8ea8da1742caea0b5': fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
Diffstat (limited to 'include/utils/RefBase.h')
-rw-r--r--include/utils/RefBase.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/include/utils/RefBase.h b/include/utils/RefBase.h
index e88cb29..4a41830 100644
--- a/include/utils/RefBase.h
+++ b/include/utils/RefBase.h
@@ -117,16 +117,22 @@ public:
typedef RefBase basetype;
-protected:
- RefBase();
- virtual ~RefBase();
+ // used to override the RefBase destruction.
+ class Destroyer {
+ friend class RefBase;
+ public:
+ virtual ~Destroyer();
+ private:
+ virtual void destroy(RefBase const* base) = 0;
+ };
- // 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;
+ void setDestroyer(Destroyer* destroyer);
+
+protected:
+ RefBase();
+ virtual ~RefBase();
//! Flags for extendObjectLifetime()
enum {