Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

juce_core: Fix infinite allocation loop in AllocationHooks #1357

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

aggniesz
Copy link
Contributor

AllocationHooks has a ListenerList member variable which was recently updated to allocate on instantiation of its internal listeners list:
const SharedListeners listeners = std::make_shared<ArrayType>();

Call to std::make_shared allocates which results in an infinite loop: operator new is called which attempts to access the static AllocationHooks object which does not yet exist - so the constructor gets called again, which then calls operator new again, and so round and round it goes - which unfortunately renders that feature unusable at the moment.

As nice as maintaining a unified approach to handling listeners would be, I don't think there's much need to support multiple listeners as AllocationHooks primary reason for existence is UnitTestAllocationChecker so I've simplified it to handle a single Listener only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant