From 954e3e1dda396f80ce2dfe742469e069146dcaa4 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sat, 26 Feb 2011 15:13:40 +0100 Subject: [PATCH] Clean up exceptions. The description generated by %@ is automatically released, so no need for an autorelease pool. --- src/XMPPExceptions.m | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/XMPPExceptions.m b/src/XMPPExceptions.m index db28f74..357f8db 100644 --- a/src/XMPPExceptions.m +++ b/src/XMPPExceptions.m @@ -64,15 +64,11 @@ - (OFString*)description { - OFAutoreleasePool *pool; - if (description != nil) return description; - pool = [[OFAutoreleasePool alloc] init]; description = [[OFString alloc] initWithFormat: - @"An exception occurred in class %@!", [self className]]; - [pool release]; + @"An exception occurred in class %@!", inClass]; return description; } @@ -130,16 +126,12 @@ - (OFString*)description { - OFAutoreleasePool *pool; - if (description != nil) return description; - pool = [[OFAutoreleasePool alloc] init]; description = [[OFString alloc] initWithFormat: @"Stringprep with profile %@ failed on string '%@'!", profile, string]; - [pool release]; return description; } @@ -197,16 +189,11 @@ - (OFString*)description { - OFAutoreleasePool *pool; - if (description != nil) return description; - pool = [[OFAutoreleasePool alloc] init]; description = [[OFString alloc] initWithFormat: - @"IDNA operation %@ failed on string '%@'!", - operation, string]; - [pool release]; + @"IDNA operation %@ failed on string '%@'!", operation, string]; return description; } @@ -259,15 +246,11 @@ - (OFString*)description { - OFAutoreleasePool *pool; - if (description != nil) return description; - pool = [[OFAutoreleasePool alloc] init]; description = [[OFString alloc] initWithFormat: @"Authentication failed. Reason: %@!", reason]; - [pool release]; return description; }