From da50d552321c8bcf1108ebaf2ef21c08bf77956d Mon Sep 17 00:00:00 2001 From: Andrew McGeachie Date: Wed, 21 Jul 2010 19:14:44 +0000 Subject: [PATCH] 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 --- lib/cocoa/src/protocol/TBinaryProtocol.m | 2 +- 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 5999e250..b2727167 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 ) 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 23b3d105..5f7fa3cc 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 processor = [mProcessorFactory processorForTransport: transport]; - id inProtocol = [mInputProtocolFactory newProtocolOnTransport: transport]; - id outProtocol = [mOutputProtocolFactory newProtocolOnTransport: transport]; + id inProtocol = [[mInputProtocolFactory newProtocolOnTransport: transport] autorelease]; + id outProtocol = [[mOutputProtocolFactory newProtocolOnTransport: transport] autorelease]; @try { BOOL result = NO; -- 2.17.1