Re: bluetooth inquiry - _NSAuroreleaseNoPool - ANSI C
site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com autopool.h: void* pool_create(); void pool_destroy(void*); autopool.m void* pool_create() { return [[NSAutoreleasePool] alloc] init]; } void pool_destroy(void* pool) { [(id)pool release]; } And in your ANSI C functions: #include "autopool.h" ... void foo() { void* pool = pool_create(); ... call bluetooth API here ... pool_release(pool); // Also, call this before early returns } Just link against Foundation.framework from your project. Joe K. On Nov 26, 2007, at 6:34 AM, Tom Burger wrote: Hi all, I am programming ANSI C and have the device inquiry working but I still get some warnings sometimes. I've seen that there is no AutoreleasePool in ANSI C, only in Objective C; thus creating one isn't possible. So I am back again by the Bluetooth API, thus I post to this mailinglist. I think the device inquiry will create objects/structs in memory that should be cleared. I normally get only these errors while repeating the device inquiry. My guess is that the found devices are not always cleared by the OS. 2007-11-24 17:26:02.363 java[6646] *** _NSAutoreleaseNoPool(): Object 0x31c420 of class NSIdEnumerator autoreleased with no pool in place - just leaking 2007-11-24 17:26:02.364 java[6646] *** _NSAutoreleaseNoPool(): Object 0x31e870 of class IOBluetoothNotification autoreleased with no pool in place - just leaking 2007-11-24 17:26:02.364 java[6646] *** _NSAutoreleaseNoPool(): Object 0x31aa20 of class NSCFArray autoreleased with no pool in place - just leaking Can anyone help me? Kind regards, Tom _______________________________________________ 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/joeman%40mac.com _______________________________________________ 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... If you're using the Bluetooth SDK, then you are already indirectly linking against Foundation.framework, so you should be able to include some objective-c code in your program as follows: This email sent to joeman@mac.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Joseph Kelly