summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kaliski <kaliskiszymon@gmail.com>2015-12-04 13:29:32 +0100
committerSzymon Kaliski <kaliskiszymon@gmail.com>2015-12-04 13:29:32 +0100
commit22f6344e3ed90619a639258157744b4ef7db5754 (patch)
tree394ffc10c830202c12cbf511a316430562c24603
parent28321c051ed849b0fbd1f7b1aaee19b8ca807390 (diff)
Fix for closing virtual ports on OSX
-rw-r--r--RtMidi.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/RtMidi.cpp b/RtMidi.cpp
index ce6db63..4873d3d 100644
--- a/RtMidi.cpp
+++ b/RtMidi.cpp
@@ -956,11 +956,17 @@ void MidiOutCore :: openPort( unsigned int portNumber, const std::string portNam
void MidiOutCore :: closePort( void )
{
- if ( connected_ ) {
- CoreMidiData *data = static_cast<CoreMidiData *> (apiData_);
+ CoreMidiData *data = static_cast<CoreMidiData *> (apiData_);
+
+ if ( data->endpoint ) {
+ MIDIEndpointDispose( data->endpoint );
+ }
+
+ if ( data->port ) {
MIDIPortDispose( data->port );
- connected_ = false;
}
+
+ connected_ = false;
}
void MidiOutCore :: openVirtualPort( std::string portName )