Force Sleep causes memory leak in IOBluetoothGetVersion() ?
site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com Hi all, I'm running Mac OS X 10.3.5. Any help is much appreciated! Mark My program: ------------ #include <CoreFoundation/CoreFoundation.h> #include <IOBluetooth/IOBluetoothUserLib.h> int main () { BluetoothHCIVersionInfo hwVersion; IOReturn ioRet = IOBluetoothGetVersion(NULL, &hwVersion); if (ioRet != kIOReturnSuccess) { fprintf(stderr, "No Bluetooth hardware found, error=0x%8x\n", ioRet); return 1; } fprintf(stderr, "Bluetooth hardware detected\n"); CFRunLoopRun(); return 0; } I compile it with: ---------------- cc bttest.c -framework CoreServices -framework IOBluetooth -o bttest The program below prints "...autoreleased with no pool in place..."-messages every time my Mac wakes from Force Sleep while the program is running. This leaves me with two questions: 1. Why would sleep/wake want to release objects in my application? 2. How do I fix this memory leak - need I create an AutoreleasePool? Here's the output: ---------------- Bluetooth hardware detected 2004-11-05 21:16:28.824 bttest[2458] *** _NSAutoreleaseNoPool(): Object 0x50a870 of class NSIdEnumerator autoreleased with no pool in place - just leaking 2004-11-05 21:16:28.826 bttest[2458] *** _NSAutoreleaseNoPool(): Object 0x50c570 of class IOBluetoothNotification autoreleased with no pool in place - just leaking 2004-11-05 21:16:28.828 bttest[2458] *** _NSAutoreleaseNoPool(): Object 0x501d70 of class NSCFArray autoreleased with no pool in place - just leaking 2004-11-05 21:16:38.766 bttest[2458] *** _NSAutoreleaseNoPool(): Object 0x509a70 of class NSIdEnumerator autoreleased with no pool in place - just leaking 2004-11-05 21:16:38.767 bttest[2458] *** _NSAutoreleaseNoPool(): Object 0x50c570 of class IOBluetoothNotification autoreleased with no pool in place - just leaking 2004-11-05 21:16:38.767 bttest[2458] *** _NSAutoreleaseNoPool(): Object 0x50c840 of class NSCFArray autoreleased with no pool in place - just leaking _______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Mark de Rooi