diff options
| author | 2011-06-12 18:05:53 -0700 | |
|---|---|---|
| committer | 2011-06-13 13:58:34 -0700 | |
| commit | afffa8fa9f82a7343e1158bf921931fd3e3df615 (patch) | |
| tree | 04e6d9721d21895ca93b209f98db8b5b65ab9991 /include/utils | |
| parent | d027329cd6105c05c157e3858a170e4f04eb0e3e (diff) | |
fix RefBase so it retains binary-compatibility with gingerbread (DO NOT MERGE)
Bug: 4595257
Change-Id: I4773cf4fe59b2509db0ed733739eb6961d473b25
Diffstat (limited to 'include/utils')
| -rw-r--r-- | include/utils/RefBase.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/include/utils/RefBase.h b/include/utils/RefBase.h index 1b4a310008ad..d92cfb03d718 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 { |