From a73f7027a77b32be8531b009bd151f18c69cbf77 Mon Sep 17 00:00:00 2001 From: c vw Date: Fri, 7 May 2021 11:41:37 +0200 Subject: [PATCH] eliminated the "dispose" functions when closing a MIDI connection. --- mac_midi.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/mac_midi.c b/mac_midi.c index 15bace7..e126a15 100644 --- a/mac_midi.c +++ b/mac_midi.c @@ -194,10 +194,6 @@ void close_midi_device(index) { // This should release the resources associated with the pending connection // MIDIPortDisconnectSource(myMIDIports[index], MIDIGetSource(index)); - MIDIPortDispose(myMIDIports[index]); - MIDIClientDispose(myClients[index]); - myMIDIports[index]=0; - myClients[index]=0; midi_devices[index].active=0; } @@ -221,17 +217,11 @@ int register_midi_device(int index) { osret=MIDIInputPortCreate(myClients[index], CFSTR("FromMIDI"), ReadMIDIdevice, NULL, &myMIDIports[index]); if (osret !=0) { g_print("%s: MIDIInputPortCreate failed with ret=%d\n", __FUNCTION__, (int) osret); - MIDIClientDispose(myClients[index]); - myClients[index]=0; return -1; } osret=MIDIPortConnectSource(myMIDIports[index] ,MIDIGetSource(index), NULL); if (osret != 0) { g_print("%s: MIDIPortConnectSource failed with ret=%d\n", __FUNCTION__, (int) osret); - MIDIClientDispose(myClients[index]); - myClients[index]=0; - MIDIPortDispose(myMIDIports[index]); - myMIDIports[index]=0; return -1; } // -- 2.45.2