From b9985099fbf2120c15f7d0b673db5128113e95c8 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 18 Jun 2013 19:33:19 -0400 Subject: [PATCH] Fix a silly memory bug where MessageQueue._message was autoreleased. --- Source/MessageQueue.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/MessageQueue.m b/Source/MessageQueue.m index b4e0642..986eb07 100644 --- a/Source/MessageQueue.m +++ b/Source/MessageQueue.m @@ -297,7 +297,7 @@ static void MessageQueueWriteEvent(CFWriteStreamRef stream, // Read the message header: the size. This will be |partLength| bytes. _totalMessageSize = atoi(charBuffer + bufferOffset); _messageSize = 0; - _message = [NSMutableString stringWithCapacity:_totalMessageSize]; + _message = [[NSMutableString alloc] initWithCapacity:_totalMessageSize]; bufferOffset += partLength + 1; // Pass over the NUL byte. continue; // Spin the loop to begin reading actual data. } -- 2.43.5