Please don't remove SharedResourcePointer::getReferenceCount()

Hi, JUCE team.

We recently upgraded our JUCE version to v7.0.12 and now We get the following message at build time.

If you are relying on this function please inform the JUCE team as we are planing on removing this in a subsequent release

The plugin we are developing uses juce::SharedResourcePointer::getReferenceCount() to perform processing only when the last instance is destroyed if multiple plugins are running.

I’m reporting this because I don’t want it to be deleted.
Please consider the matter.

1 Like

Isn’t that what the destructor of whatever the shared resource is should do? If you have to check the counter manually to do something, it could hint at something odd in the design.

2 Likes

I agree… I need to call

juce::Logger::setCurrentLogger (nullptr);

only when the last instance is destroyed otherwise the other instances stop logging.

Rail

Could you move that call into the destructor of an object managed by a shared resource pointer?

Seems to me the fix would be making the juce::Logger a sharedResourcePtr instead of a static object.

Rail

Another use case:

I use getReferenceCount() to check if required resource already exists, and doesn’t need to be constructed, in a time-critical constructor, in a debugging context.

@reuk