• 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: C++ thread messaging cocoa thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: C++ thread messaging cocoa thread
      • From: Simon Strandgaard <email@hidden>
References: 
 >C++ thread messaging cocoa thread (From: Simon Strandgaard <email@hidden>)

  • Prev by Date: Displaying multiple NSView subclasses
  • Next by Date: Re: Displaying multiple NSView subclasses
  • Previous by thread: C++ thread messaging cocoa thread
  • Next by thread: Re: C++ thread messaging cocoa thread
  • Index(es):
    • Date
    • Thread