From e3736190847a805f17561f8ee3c774ba98c81173 Mon Sep 17 00:00:00 2001 From: Andrew Madsen Date: Wed, 11 Nov 2015 14:34:07 -0700 Subject: [PATCH] Issue #106: Explicitly unconnected devices in saved configuration are disconnected upon calling -[MIKMIDIConfigurationManager loadConfiguration]. --- Source/MIKMIDIConnectionManager.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/MIKMIDIConnectionManager.m b/Source/MIKMIDIConnectionManager.m index af213385..111c5220 100644 --- a/Source/MIKMIDIConnectionManager.m +++ b/Source/MIKMIDIConnectionManager.m @@ -150,7 +150,9 @@ - (void)saveConfiguration - (void)loadConfiguration { for (MIKMIDIDevice *device in self.availableDevices) { - if ([self deviceIsConnectedInSavedConfiguration:device]) { + if ([self deviceIsUnconnectedInSavedConfiguration:device]) { + [self internalDisconnectFromDevice:device]; + } else if ([self deviceIsConnectedInSavedConfiguration:device]) { NSError *error = nil; if (![self internalConnectToDevice:device error:&error]) { NSLog(@"Unable to connect to MIDI device %@: %@", device, error);