summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-06-12 18:05:53 -0700
committerMathias Agopian <mathias@google.com>2011-06-13 13:44:28 -0700
commita9c9a4baf24700e8817d47d8ea8da1742caea0b5 (patch)
treeebc1fd1110292ff2f544838ddc7a85dd72b423a0 /include
parentfd63814abe8e81d5e1e0eb75b5a5a18034e9b4c6 (diff)
downloadframeworks_base-a9c9a4baf24700e8817d47d8ea8da1742caea0b5.zip
frameworks_base-a9c9a4baf24700e8817d47d8ea8da1742caea0b5.tar.gz
frameworks_base-a9c9a4baf24700e8817d47d8ea8da1742caea0b5.tar.bz2
fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
Bug: 4595257 Change-Id: I1db83149107d7dab1f0b7e73c684e0ff82e17e62
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 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 {