Cleaned up memory leaks.
parent
6f6b01b15c
commit
97a278a143
|
@ -253,6 +253,8 @@
|
|||
|
||||
- (void)endOfInputPlayed
|
||||
{
|
||||
[bufferChain release];
|
||||
|
||||
if ([chainQueue count] <= 0)
|
||||
{
|
||||
//End of playlist
|
||||
|
@ -260,7 +262,6 @@
|
|||
|
||||
return;
|
||||
}
|
||||
[bufferChain release];
|
||||
|
||||
bufferChain = [chainQueue objectAtIndex:0];
|
||||
[bufferChain retain];
|
||||
|
|
|
@ -105,10 +105,13 @@
|
|||
- (void)dealloc
|
||||
{
|
||||
[userInfo release];
|
||||
[streamURL release];
|
||||
|
||||
[inputNode release];
|
||||
[converterNode release];
|
||||
|
||||
NSLog(@"Bufferchain dealloc");
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
|
|
@ -140,6 +140,14 @@ static OSStatus ACInputProc(AudioConverterRef inAudioConverter, UInt32* ioNumber
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
NSLog(@"Decoder dealloc");
|
||||
[self cleanUp];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
- (void)setOutputFormat:(AudioStreamBasicDescription)format
|
||||
{
|
||||
NSLog(@"SETTING OUTPUT FORMAT!");
|
||||
|
@ -160,6 +168,9 @@ static OSStatus ACInputProc(AudioConverterRef inAudioConverter, UInt32* ioNumber
|
|||
AudioConverterDispose(converter);
|
||||
converter = NULL;
|
||||
}
|
||||
if (callbackBuffer) {
|
||||
free(callbackBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -151,7 +151,7 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
NSLog(@"DEALLOCATING");
|
||||
NSLog(@"Input Node dealloc");
|
||||
|
||||
[decoder removeObserver:self forKeyPath:@"properties"];
|
||||
[decoder removeObserver:self forKeyPath:@"metadata"];
|
||||
|
|
|
@ -219,4 +219,14 @@
|
|||
}
|
||||
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[buffer release];
|
||||
[semaphore release];
|
||||
[readLock release];
|
||||
[writeLock release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -235,6 +235,8 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
|||
{
|
||||
[self stop];
|
||||
|
||||
[[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self forKeyPath:@"values.outputDevice"];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ escapeForLastFM(NSString *string)
|
|||
|
||||
- (void) processAudioScrobblerCommands:(AudioScrobbler *)myself
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSAutoreleasePool *pool = nil;
|
||||
AudioScrobblerClient *client = [[AudioScrobblerClient alloc] init];
|
||||
mach_timespec_t timeout = { 5, 0 };
|
||||
NSEnumerator *enumerator = nil;
|
||||
|
@ -201,6 +201,9 @@ escapeForLastFM(NSString *string)
|
|||
in_port_t port = 33367;
|
||||
|
||||
while([myself keepProcessingAudioScrobblerCommands]) {
|
||||
if (pool)
|
||||
[pool release];
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
// Get the first command to be sent
|
||||
@synchronized([myself queue]) {
|
||||
|
@ -235,6 +238,8 @@ escapeForLastFM(NSString *string)
|
|||
semaphore_timedwait([myself semaphore], timeout);
|
||||
}
|
||||
|
||||
[pool release];
|
||||
|
||||
// Send a final stop command to cleanup
|
||||
@try {
|
||||
if([client connectToHost:@"localhost" port:port]) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
result = [NSString stringWithFormat:@"%i", value];
|
||||
|
||||
return [[result retain] autorelease];
|
||||
return result;
|
||||
}
|
||||
|
||||
- (BOOL) getObjectValue:(id *)object forString:(NSString *)string errorDescription:(NSString **)error
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
result = [NSString stringWithFormat:@"0:%.2u", seconds];
|
||||
}
|
||||
|
||||
return [[result retain] autorelease];
|
||||
return result;
|
||||
}
|
||||
|
||||
- (BOOL) getObjectValue:(id *)object forString:(NSString *)string errorDescription:(NSString **)error
|
||||
|
|
|
@ -52,6 +52,8 @@
|
|||
|
||||
- (void)close
|
||||
{
|
||||
[self setURL:nil];
|
||||
|
||||
fclose(_fd);
|
||||
}
|
||||
|
||||
|
@ -73,4 +75,10 @@
|
|||
return [NSArray arrayWithObject:@"file"];
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
NSLog(@"DEALLOCATING SOURCE");
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -117,6 +117,8 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[self setURL:nil];
|
||||
|
||||
[_socket release];
|
||||
[_url release];
|
||||
|
||||
|
|
|
@ -547,14 +547,25 @@ static inline signed int scale (mad_fixed_t sample)
|
|||
}
|
||||
|
||||
- (void)close
|
||||
{
|
||||
if (_source)
|
||||
{
|
||||
[_source close];
|
||||
[_source release];
|
||||
_source = nil;
|
||||
}
|
||||
|
||||
mad_synth_finish(&_synth);
|
||||
mad_frame_finish(&_frame);
|
||||
mad_stream_finish(&_stream);
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
NSLog(@"Decoder dealloc");
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (double)seekToTime:(double)milliseconds
|
||||
{
|
||||
unsigned long new_position;
|
||||
|
|
|
@ -112,6 +112,8 @@ long sourceTell(void *datasource)
|
|||
- (void)close
|
||||
{
|
||||
ov_clear(&vorbisRef);
|
||||
|
||||
[source close];
|
||||
[source release];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue