Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Source/OCMock/OCClassMockObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ - (id)initWithClass:(Class)aClass
return self;
}

- (void)dealloc
{
[self stopMocking];
[super dealloc];
}

- (NSString *)description
{
return [NSString stringWithFormat:@"OCClassMockObject(%@)", NSStringFromClass(mockedClass)];
Expand Down
2 changes: 1 addition & 1 deletion Source/OCMock/OCMockObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ - (instancetype)init

- (void)dealloc
{
[self stopMocking];
[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.

[super dealloc];
}

Expand Down