mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Added a method WeakReference::Master::getNumActiveWeakReferences()
This commit is contained in:
parent
95053c0665
commit
bf64d88de8
1 changed files with 6 additions and 0 deletions
|
|
@ -189,6 +189,12 @@ public:
|
|||
sharedPointer->clearPointer();
|
||||
}
|
||||
|
||||
/** Returns the number of WeakReferences that are out there pointing to this object. */
|
||||
int getNumActiveWeakReferences() const noexcept
|
||||
{
|
||||
return sharedPointer == nullptr ? 0 : (sharedPointer->getReferenceCount() - 1);
|
||||
}
|
||||
|
||||
private:
|
||||
SharedRef sharedPointer;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue