Re: C++ thread messaging cocoa thread
Re: C++ thread messaging cocoa thread
- Subject: Re: C++ thread messaging cocoa thread
- From: Nick Zitzmann <email@hidden>
- Date: Thu, 14 Jul 2005 14:00:32 -0600
On Jul 14, 2005, at 1:36 PM, Simon Strandgaard wrote:
The midi_read_callback is in a thread that doesn't have a
NSAutoreleasepool, so if I invoke any methods on the
GUI instance then I get warnings like this.
_NSAutoreleaseNoPool(): Object 0xa2e89ccc of class NSCFString
autoreleased with no pool in place - just leaking
As a general rule, you shouldn't use AppKit classes in any thread
other than the main thread. There are a few classes and methods that
are thread-safe (e.g. NSProgressIndicator) but most of them aren't.
void midi_read_callback(
const MIDIPacketList *pktlist,
void *refCon,
void *connRefCon) {
// Help, How to message my cocoa mainthread?
<file:///Developer/ADC Reference Library/documentation/Cocoa/
Reference/Foundation/ObjC_classic/Classes/NSObject.html#//apple_ref/
doc/uid/20000050-CJBEHAEF>
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden