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

All subclasses of OCMockObject should get stopMocking called on them in dealloc #497

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

Conversation

dmaclach
Copy link
Contributor

This seems like a reasonable expectation of the API and in our case enables code that
depends on stopMocking to function with OCProtocolMockObjects.

…m as part of

dealloc.

This seems like a reasonable expectation of the API and in our case enables code that
depends on stopMocking to function with OCProtocolMockObjects.
[stubs release];
[expectations release];
[exceptions release];
[invocations release];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of not releasing the invocations array?

Copy link
Contributor Author

@dmaclach dmaclach Oct 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it happens in -stopMocking and that I probably thought this was redundant.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell this is the only place.

https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/erikdoe/ocmock%24++%5Binvocations+release%5D&patternType=structural

Removing it here would leak the invocations.

No need to fix on your end, I'll do it while merging.

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.

2 participants