mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-04 11:15:56 +00:00
Add reference counting to AsyncObject
This commit is contained in:
committed by
Vinnie Falco
parent
d11983ae32
commit
370d98a858
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user