summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-06-15 20:41:24 -0700
committerMathias Agopian <mathias@google.com>2011-06-15 20:42:25 -0700
commit52a43990880b27808bcf562afcc4209d34728e6e (patch)
tree413d422aa5827ad63c62125278a633b78ae77dff /include
parentd20d72d193ab0d7f33c839d8bf9573b55abfebdc (diff)
downloadframeworks_base-52a43990880b27808bcf562afcc4209d34728e6e.zip
frameworks_base-52a43990880b27808bcf562afcc4209d34728e6e.tar.gz
frameworks_base-52a43990880b27808bcf562afcc4209d34728e6e.tar.bz2
Revert "revert surfaceflinger leak fix as it uncovered a crasher on xoom"
This reverts commit af6edba59e250adbdfa5b3c3be134f70d8c38a16. Change-Id: I7793d3ca8a4d20a2b188364f47854328ab5f586d
Diffstat (limited to 'include')
-rw-r--r--include/utils/RefBase.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/utils/RefBase.h b/include/utils/RefBase.h
index b31e993..c0be597 100644
--- a/include/utils/RefBase.h
+++ b/include/utils/RefBase.h
@@ -117,6 +117,20 @@ public:
typedef RefBase basetype;
+ // used to override the RefBase destruction.
+ class Destroyer {
+ friend class RefBase;
+ friend class weakref_type;
+ public:
+ virtual ~Destroyer();
+ private:
+ virtual void destroy(RefBase const* base) = 0;
+ };
+
+ // Make sure to never acquire a strong reference from this function. The
+ // same restrictions than for destructors apply.
+ void setDestroyer(Destroyer* destroyer);
+
protected:
RefBase();
virtual ~RefBase();