Permalink
Browse files

Make sure autorelease is ignored, since we do our own reference count…

…ing.
  • Loading branch information...
1 parent a77bf53 commit 0bfa8f9a3bb424a5bd3ab7b8cfa23f93d2862165 @ccgus ccgus committed Jan 8, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 Mocha/Utilities/MOUtilities.m
@@ -306,6 +306,12 @@ JSValueRef MOFunctionInvoke(id function, JSContextRef ctx, size_t argumentCount,
target = [[target objectClass] alloc];
}
+ // Make sure autorelease is ignored, since we do our own reference counting.
+ if (selector == NSSelectorFromString(@"autorelease")) {
+ NSLog(@"Ignoring autorelease call on %@", target);
+ return [runtime JSValueForObject:target];
+ }
+
Method method = NULL;
BOOL classMethod = (target == klass);

0 comments on commit 0bfa8f9

Please sign in to comment.