erikdoe / ocmock

Mock objects for Objective-C
http://ocmock.org
Apache License 2.0
2.16k stars 606 forks source link

Add method to not retain object arguments. #348

Closed alanterranova closed 4 years ago

alanterranova commented 6 years ago

OCMock 3.4 retains arguments passed to mocks (https://github.com/erikdoe/ocmock/issues/307) so this provides reverse-compatibility for tests that rely on dealloc being called on the object under test, which was fine in OCMock 3.2 and earlier versions.

bErKut commented 6 years ago

Hi. Any chances this pull request will be merged?

erikdoe commented 6 years ago

Assuming that I merge #360, would that work for you, too?

erikdoe commented 4 years ago

Even after thinking about it in depth, I didn't come up with an approach that would solve the issue automatically. Either you have to tell OCMock early not to retain the arguments, as proposed here, or you tell it later to release them, as proposed in #360. I've decided for the latter because the approach proposed here can lead to unpredictable crashes.