From 4952eb08485c1de68204bd8ae28e0be6b9beeb89 Mon Sep 17 00:00:00 2001 From: Peter Hosey Date: Sat, 3 Nov 2007 20:45:42 +0000 Subject: [PATCH] There's no autorelease pool on the HAL thread, which is the thread that calls `systemOutputDeviceDidChange`. Therefore, we need to create our own. Fixes warnings in the ASL when the system output device changes (at least on Leopard). git-svn-id: svn://svn.adiumx.com/adium/trunk@21487 1c916fce-81e2-0310-a464-8ca513f45935 --- Source/AdiumSound.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/AdiumSound.m b/Source/AdiumSound.m index 6cdbf46c2..82f7b62ca 100644 --- a/Source/AdiumSound.m +++ b/Source/AdiumSound.m @@ -285,6 +285,8 @@ static OSStatus systemOutputDeviceDidChange(AudioHardwarePropertyID property, vo static OSStatus systemOutputDeviceDidChange(AudioHardwarePropertyID property, void *refcon) { #pragma unused(property) + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + AdiumSound *self = (id)refcon; NSCAssert1(self, @"AudioHardware property listener function %s called with nil refcon, which we expected to be the AdiumSound instance", __PRETTY_FUNCTION__); @@ -307,6 +309,8 @@ static OSStatus systemOutputDeviceDidChange(AudioHardwarePropertyID property, vo //Resume playback, now on the new device. [movie setRate:savedRate]; } + + [pool release]; return noErr; } -- 2.11.4.GIT