• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: bluetooth inquiry - _NSAuroreleaseNoPool - ANSI C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bluetooth inquiry - _NSAuroreleaseNoPool - ANSI C


  • Subject: Re: bluetooth inquiry - _NSAuroreleaseNoPool - ANSI C
  • From: Joseph Kelly <email@hidden>
  • Date: Mon, 26 Nov 2007 10:40:44 -0800

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:

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      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ 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
References: 
 >bluetooth inquiry - _NSAuroreleaseNoPool - ANSI C (From: "Tom Burger" <email@hidden>)

  • Prev by Date: bluetooth inquiry - _NSAuroreleaseNoPool - ANSI C
  • Next by Date: Re: Help me in Bluetooth programming!
  • Previous by thread: bluetooth inquiry - _NSAuroreleaseNoPool - ANSI C
  • Next by thread: Problem in including OBEX.h
  • Index(es):
    • Date
    • Thread