Skip to content

Commit

Permalink
Removed midi client disposal on Manager deinit
Browse files Browse the repository at this point in the history
  • Loading branch information
orchetect committed Feb 28, 2022
1 parent 874de47 commit 5a0b5f2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Sources/MIDIKit/IO/Manager/Manager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,9 @@ extension MIDI.IO {

deinit {
eventQueue.sync {
let result = MIDIClientDispose(coreMIDIClientRef)

if result != noErr {
// not important to log this, we can omit it for now
//let osStatusMessage = MIDIOSStatus(rawValue: result).description
//logger.debug("Error disposing of MIDI client: \(osStatusMessage)")
}
// Apple docs:
// "Don’t explicitly dispose of your client; the system automatically disposes all clients when an app terminates. However, if you call this method to dispose the last or only client owned by an app, the MIDI server may exit if there are no other clients remaining in the system"
//_ = MIDIClientDispose(coreMIDIClientRef)

NotificationCenter.default.removeObserver(self)
}
Expand Down

0 comments on commit 5a0b5f2

Please sign in to comment.