Add reference counting to AsyncObject

This commit is contained in:
Nik Bougalis
2013-12-19 14:39:26 -08:00
committed by Vinnie Falco
parent d11983ae32
commit 370d98a858
+11
View File
@@ -64,6 +64,17 @@ public:
Derived* m_owner;
};
void addReference ()
{
++m_pending;
}
void removeReference ()
{
if (--m_pending)
(static_cast <Derived *> (this))->asyncHandlersComplete ();
}
private:
// The number of handlers pending.
Atomic <int> m_pending;