summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McGeachie <geechorama@apache.org>2010-07-21 19:14:44 +0000
committerAndrew McGeachie <geechorama@apache.org>2010-07-21 19:14:44 +0000
commitda50d552321c8bcf1108ebaf2ef21c08bf77956d (patch)
treeddff9bdee3c6dbb1e81ea8a89911f8223174a295
parent99f2ab7790003138124a5791d624ed5651e4908c (diff)
downloadthrift-da50d552321c8bcf1108ebaf2ef21c08bf77956d.tar.gz
THRIFT-688. Make TBinaryProtocol obey cocoa memory allocation conventions
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@966369 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--lib/cocoa/src/protocol/TBinaryProtocol.m2
-rw-r--r--lib/cocoa/src/server/TSocketServer.m4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/cocoa/src/protocol/TBinaryProtocol.m b/lib/cocoa/src/protocol/TBinaryProtocol.m
index 5999e2508..b2727167d 100644
--- a/lib/cocoa/src/protocol/TBinaryProtocol.m
+++ b/lib/cocoa/src/protocol/TBinaryProtocol.m
@@ -37,7 +37,7 @@ static TBinaryProtocolFactory * gSharedFactory = nil;
}
- (TBinaryProtocol *) newProtocolOnTransport: (id <TTransport>) transport {
- return [[[TBinaryProtocol alloc] initWithTransport: transport] autorelease];
+ return [[TBinaryProtocol alloc] initWithTransport: transport];
}
@end
diff --git a/lib/cocoa/src/server/TSocketServer.m b/lib/cocoa/src/server/TSocketServer.m
index 23b3d1054..5f7fa3ccc 100644
--- a/lib/cocoa/src/server/TSocketServer.m
+++ b/lib/cocoa/src/server/TSocketServer.m
@@ -124,8 +124,8 @@ NSString * const kTSockerServer_TransportKey = @"TSockerServer_Transport";
TNSFileHandleTransport * transport = [[TNSFileHandleTransport alloc] initWithFileHandle: clientSocket];
id<TProcessor> processor = [mProcessorFactory processorForTransport: transport];
- id <TProtocol> inProtocol = [mInputProtocolFactory newProtocolOnTransport: transport];
- id <TProtocol> outProtocol = [mOutputProtocolFactory newProtocolOnTransport: transport];
+ id <TProtocol> inProtocol = [[mInputProtocolFactory newProtocolOnTransport: transport] autorelease];
+ id <TProtocol> outProtocol = [[mOutputProtocolFactory newProtocolOnTransport: transport] autorelease];
@try {
BOOL result = NO;