Force Sleep causes memory leak in IOBluetoothGetVersion() ?
Force Sleep causes memory leak in IOBluetoothGetVersion() ?
- Subject: Force Sleep causes memory leak in IOBluetoothGetVersion() ?
- From: Mark de Rooi <email@hidden>
- Date: Fri, 5 Nov 2004 21:37:34 +0100
Hi all,
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?
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
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden