stubbing seems to leak parameter objects

Discussion of the OCMock framework. If you have patches we would prefer you to send them to the mailing list, but attaching them to a topic is possible, too.

stubbing seems to leak parameter objects

Postby micahhainline » 03 Nov 2011, 23:33

I've got an interesting situation in which my test objects are getting leaked when I use the stub method:

[[myMock stub] doSomethingAndCallTarget: theTarget selector: @selector(selectorToCall:)];

This leaks "theTarget". If I use an expect / verify it doesn't leak

[[myMock expect] doSomethingAndCallTarget: theTarget selector: @selector(selectorToCall:)];
// ...
[myMock verify];

Is it needed to retain the parameters here? If so, how can we fix the leak?

It's exacerbated by the fact that we can't clear stubs once we set them. Any workaround solutions would be awesome.
micahhainline
 
Posts: 2
Joined: 03 Nov 2011, 23:23

Return to OCMock