Index: ios/testing/ocmock_complex_type_helper.mm |
diff --git a/ios/testing/ocmock_complex_type_helper.mm b/ios/testing/ocmock_complex_type_helper.mm |
index bc89a887d2515b926f72c83fd20f76b07b74b817..441e2b1f517f1d140ec36c8d210af5183a5f3310 100644 |
--- a/ios/testing/ocmock_complex_type_helper.mm |
+++ b/ios/testing/ocmock_complex_type_helper.mm |
@@ -7,6 +7,10 @@ |
#include "base/logging.h" |
#include "base/mac/scoped_nsobject.h" |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
+ |
@implementation OCMockComplexTypeHelper { |
// Same as the superclass -representedObject, but retained. |
base::scoped_nsobject<OCMockObject> _object; |
@@ -18,7 +22,7 @@ |
- (instancetype)initWithRepresentedObject:(id)object { |
if ((self = [super initWithRepresentedObject:object])) |
- _object.reset([object retain]); |
+ _object.reset(object); |
return self; |
} |