WeakReferenceable: Clear fUseCount when it is 1.

Otherwise, if there are remaining weak references, they could
potentially try to acquire the object and trigger a use-after-free.
This commit is contained in:
Augustin Cavalier
2023-01-31 22:36:59 -05:00
parent b956691cdd
commit 5d41cee816
2 changed files with 6 additions and 1 deletions
@@ -30,6 +30,8 @@ public:
void GetUnchecked();
private:
friend class BWeakReferenceable;
int32 fUseCount;
BWeakReferenceable* fObject;
};