Closed lebad closed 4 years ago
I'm pretty sure once you stub a class method you have to manually stop mocking.
Although, I don't really know why you have to manually call -stopMocking
the more I look at it. Even if you do, the mock object still doesn't appear to deallocate, maybe there's a leak hiding here somewhere? The trigger appears to be stubbing a class method.
I think this is fixed by #363, which is released in OCMock 3.5. Can you double-check, please?
Closing due to inactivity. Assume fixed.
This issue happens all the time when I stub a mock object and use
andReturn
with this mock object or useOCMArg
with reference to this mock object.Example with singleton stubbing:
dealloc
is never called as well asstopMocking
Example with
OCMArg
stubbing:So we have memory leaking here and should manually call
stopMocking
to prevent unexpected behavior.Is there any way to fix this problem?
Thanks!