summaryrefslogtreecommitdiffstats
path: root/include/utils/RefBase.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-06-13 14:15:00 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-06-13 14:15:00 -0700
commitc031afc8e9ad6c940c7d67a15b9c53092987377e (patch)
tree71f384a3f6592d8acfa591db59bae6c26f9c8d50 /include/utils/RefBase.h
parentc793f521e5ace1dca39d65de3ed60d7c8242f661 (diff)
parent77079399fca3e9c71e2ac06f3da26934e1c278b9 (diff)
downloadframeworks_base-c031afc8e9ad6c940c7d67a15b9c53092987377e.zip
frameworks_base-c031afc8e9ad6c940c7d67a15b9c53092987377e.tar.gz
frameworks_base-c031afc8e9ad6c940c7d67a15b9c53092987377e.tar.bz2
am 77079399: am a9c9a4ba: fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
* commit '77079399fca3e9c71e2ac06f3da26934e1c278b9': 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 {