Fixed Last.fm command queue crashing
This commit is contained in:
parent
70e571fed9
commit
9041ba977f
1 changed files with 5 additions and 1 deletions
|
@ -221,7 +221,7 @@ escapeForLastFM(NSString *string)
|
||||||
// Get the first command to be sent
|
// Get the first command to be sent
|
||||||
@synchronized([self queue]) {
|
@synchronized([self queue]) {
|
||||||
if ([[self queue] count]) {
|
if ([[self queue] count]) {
|
||||||
command = [[self queue] objectAtIndex:0];
|
command = [[[self queue] objectAtIndex:0] retain];
|
||||||
[[self queue] removeObjectAtIndex:0];
|
[[self queue] removeObjectAtIndex:0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,6 +232,7 @@ escapeForLastFM(NSString *string)
|
||||||
port = [client connectedPort];
|
port = [client connectedPort];
|
||||||
[client send:command];
|
[client send:command];
|
||||||
[command release];
|
[command release];
|
||||||
|
command = nil;
|
||||||
|
|
||||||
response = [client receive];
|
response = [client receive];
|
||||||
if(2 > [response length] || NSOrderedSame != [response compare:@"OK" options:NSLiteralSearch range:NSMakeRange(0,2)])
|
if(2 > [response length] || NSOrderedSame != [response compare:@"OK" options:NSLiteralSearch range:NSMakeRange(0,2)])
|
||||||
|
@ -242,6 +243,9 @@ escapeForLastFM(NSString *string)
|
||||||
}
|
}
|
||||||
|
|
||||||
@catch(NSException *exception) {
|
@catch(NSException *exception) {
|
||||||
|
[command release];
|
||||||
|
command = nil;
|
||||||
|
|
||||||
[client shutdown];
|
[client shutdown];
|
||||||
// ALog(@"Exception: %@",exception);
|
// ALog(@"Exception: %@",exception);
|
||||||
[pool release];
|
[pool release];
|
||||||
|
|
Loading…
Reference in a new issue