diff options
Diffstat (limited to 'include/utils/RefBase.h')
-rw-r--r-- | include/utils/RefBase.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/utils/RefBase.h b/include/utils/RefBase.h index a21a18bda..ca170827f 100644 --- a/include/utils/RefBase.h +++ b/include/utils/RefBase.h @@ -116,6 +116,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(); |