1
0
Fork 0
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:
jules 2017-10-19 11:57:56 +01:00
parent 95053c0665
commit bf64d88de8

View file

@ -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;