diff options
author | Andrew McGeachie <geechorama@apache.org> | 2010-07-21 19:14:44 +0000 |
---|---|---|
committer | Andrew McGeachie <geechorama@apache.org> | 2010-07-21 19:14:44 +0000 |
commit | da50d552321c8bcf1108ebaf2ef21c08bf77956d (patch) | |
tree | ddff9bdee3c6dbb1e81ea8a89911f8223174a295 /lib/cocoa | |
parent | 99f2ab7790003138124a5791d624ed5651e4908c (diff) | |
download | thrift-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
Diffstat (limited to 'lib/cocoa')
-rw-r--r-- | lib/cocoa/src/protocol/TBinaryProtocol.m | 2 | ||||
-rw-r--r-- | lib/cocoa/src/server/TSocketServer.m | 4 |
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; |