Skip to content

Commit 0abeea9

Browse files
committed
Merge branch 'dmaclach-returnValue'
2 parents c4ec0e3 + 3c256be commit 0abeea9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Source/OCMock/OCMNonRetainingObjectReturnValueProvider.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ - (void)handleInvocation:(NSInvocation *)anInvocation
4646
[returnValue retain];
4747
[[anInvocation target] release];
4848
}
49+
else
50+
{
51+
// avoid potential problems with the return value being release too early
52+
returnValue = [[returnValue retain] autorelease];
53+
}
4954
[anInvocation setReturnValue:&returnValue];
5055
}
5156
@end

0 commit comments

Comments
 (0)