When returned object is the same as the mocked object for stub - do not invoke retain.
Mocked-object's lifetime is always longer than stub-object’s, therefore we do not worry that stub-object will be freed earlier than mocked-object(aka returned object).
Fixing issue: https://github.com/erikdoe/ocmock/issues/356 In current commit there are: example of the #365 issue and its solution.
When returned object is the same as the mocked object for stub - do not invoke retain. Mocked-object's lifetime is always longer than stub-object’s, therefore we do not worry that stub-object will be freed earlier than mocked-object(aka returned object).
Co-Authored-By: QB victoriaqb@users.noreply.github.com