From 083a898de6dae2b428480bf4085cf9d1d9d07dd4 Mon Sep 17 00:00:00 2001 From: vspader Date: Mon, 26 Feb 2007 04:23:13 +0000 Subject: [PATCH] Fixed crash with audioscrobbler. --- AudioScrobbler/AudioScrobbler.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AudioScrobbler/AudioScrobbler.m b/AudioScrobbler/AudioScrobbler.m index 5cbcc81a4..a3c4e52ea 100644 --- a/AudioScrobbler/AudioScrobbler.m +++ b/AudioScrobbler/AudioScrobbler.m @@ -203,7 +203,7 @@ escapeForLastFM(NSString *string) @synchronized([myself queue]) { enumerator = [[myself queue] objectEnumerator]; - command = [enumerator nextObject]; + command = [[enumerator nextObject] retain]; [[myself queue] removeObjectIdenticalTo:command]; } @@ -213,6 +213,8 @@ escapeForLastFM(NSString *string) port = [client connectToHost:@"localhost" port:port]; [client send:command]; + [command release]; + response = [client receive]; if(2 > [response length] || NSOrderedSame != [response compare:@"OK" options:NSLiteralSearch range:NSMakeRange(0,2)]) { NSLog(@"AudioScrobbler error: %@", response);