summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-06-15 14:13:04 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-06-15 14:13:04 -0700
commit5137711109783dcbb20143d3e5cab2fa931218dd (patch)
tree62cf965ceb33e20e3dfb357564f8d7bdbedc48cc /include
parentd8f9a83cab34de38981dc3ba5ca9df8dda02dbc0 (diff)
parentafffa8fa9f82a7343e1158bf921931fd3e3df615 (diff)
downloadframeworks_base-5137711109783dcbb20143d3e5cab2fa931218dd.zip
frameworks_base-5137711109783dcbb20143d3e5cab2fa931218dd.tar.gz
frameworks_base-5137711109783dcbb20143d3e5cab2fa931218dd.tar.bz2
am afffa8fa: fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
* commit 'afffa8fa9f82a7343e1158bf921931fd3e3df615': fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
Diffstat (limited to 'include')
-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 1b4a310..d92cfb0 100644
--- a/include/utils/RefBase.h
+++ b/include/utils/RefBase.h
@@ -112,16 +112,22 @@ public:
getWeakRefs()->trackMe(enable, retain);
}
-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 {