0

I'm developing an Audio Unit with a custom view, setting ARC when building it in XCode. When It runs in LogicX everything is fine except after having closed the window of my view. When I try to (re)open it, it crashes in :

void EventListenerDispatcher (void *inRefCon,
                              void *inObject,
                              const AudioUnitEvent *inEvent,
                              UInt64 inHostTime,
                              Float32 inValue)
{
    myCustomView* SELF = (__bridge myCustomView*)inRefCon;
    [SELF jaEventListener:inObject
                    event:inEvent
                    value:inValue];
}

with a Bad_Access error on the "myCustomView* SELF = ..." line . I suppose that ARC has released the view and, when reopened, the view is not valid anymore. If so, how can I make the view not be released by ARC? Could there be another reason it crashes?

JLDB
  • 31
  • 3
  • Have a look at these: http://stackoverflow.com/questions/21965300/using-arc-for-the-cocoa-ui-of-an-audiounit-prevents-nsview-dealloc-from-being-ca https://developer.apple.com/library/mac/documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/TheAudioUnitView/TheAudioUnitView.html#//apple_ref/doc/uid/TP40003278-CH13-SW7 – ruoho ruotsi Apr 08 '15 at 06:02
  • Thank you for your answer. I will adapt my code ans test... :-) – JLDB Apr 09 '15 at 09:17

0 Answers0