Re: MIDI Rescan: Panther vs. Jaguar
Re: MIDI Rescan: Panther vs. Jaguar
- Subject: Re: MIDI Rescan: Panther vs. Jaguar
- From: Pete Gontier <email@hidden>
- Date: Wed, 21 Apr 2004 20:16:05 -0700
circa 4/21/04 11:28, Pete Gontier <email@hidden> wrote:
>
I did discover what appears to be an unexpected oddness in IOKitLib. I'm
>
getting interest messages for deleted notifications, and this was causing an
>
assertion failure in my code of which I wasn't aware, and that in turn was
>
causing an unexpected exception during the stop/start sequence. I'll work
>
around that issue and then revisit the disappearing devices.
Mission accomplished. Not a CoreMIDI problem. Sorry for the wild goose
chase.
Jaguar delivers USB service termination messages even after the notification
has been destroyed. I don't know why. I had been using the refCon parameter
to the notification callback as a pointer to the C++ object representing the
notification, but by the time the notification callback occurred, the object
was already destroyed and the pointer was stale.
The solution was to give each C++ object a unique ID and associate the ID
with the object pointer in a table. The callback gets an ID from the
callback refCon and looks up any corresponding C++ object in the table. If
there is no such object, the callback is ignored (except that it mumbles to
the debug log).
When I hit the Rescan button in Jaguar Audio MIDI Setup, I get a debug log
mumble about an unmapped object. When I hit the Rescan button in Panther
Audio MIDI Setup, I do not get such a mumble. I don't know why the two
differ; I suppose I could look it up in Darwin if I needed to know more.
--
Pete Gontier
http://www.m-audio.com/
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.