• 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
MusicSequenceSetUserCallback - GC error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MusicSequenceSetUserCallback - GC error


  • Subject: MusicSequenceSetUserCallback - GC error
  • From: GW Rodriguez <email@hidden>
  • Date: Sat, 05 Nov 2011 15:07:35 -0700

I have an application running with GC required, that has 2 main classes: the delegate class and a class that manages all the MusicPlayer functionality.  In the MusicPlayer class I have a method to set the callback:

-(void) setCallback: (MusicSequenceUserCallback) callback {
     OSStatus err = MusicSequenceSetUserCallback(seq, callback, [[NSApplication sharedapplication] delegate]);
     assert(err == noErr);
}

My custom callback function is in the delegate class so I set the callback with this method above.  Every time I start the music player I get this error:

 malloc: *** auto malloc[3564]: error: GC operation on unregistered thread. Thread registered implicitly. Break on auto_zone_thread_registration_error() to debug.


The program does everything that I want it to do, but I get that error.  When I change the MusicSequenceSetUserCallback's 3 argument to nil I still get the error but my code doesn't work.  

I guess my main question is: what does the third argument (void* inClientData) really want to be when you want to pass a class?  My callback looks something like this:

static void cBackAutomation (void *inClientData, MusicSequence inSequence, MusicTrack inTrack, MusicTimeStamp inEventTime, const MusicEventUserData *inEventData, MusicTimeStamp inStartSliceBeat, MusicTimeStamp inEndSliceBeat) {

    Float64 x = inEventTime*25;

    MyDelegateClass *mainClass = inClientData;

    Float64 y = [mainClass yValueAt:x];

    y *= 2;

    NSLog(@"*** y value: %.2f", y);

    [mainClass release];

};


--  
GW Rodriguez

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: MusicSequenceSetUserCallback - GC error
      • From: Aran Mulholland <email@hidden>
  • Prev by Date: MusicPlayer looping madness
  • Next by Date: Re: How to use REZ to create resource combining x86 and x64?
  • Previous by thread: Re: MusicPlayer looping madness
  • Next by thread: Re: MusicSequenceSetUserCallback - GC error
  • Index(es):
    • Date
    • Thread