summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kaliski <kaliskiszymon@gmail.com>2016-01-19 11:51:33 +0100
committerSzymon Kaliski <kaliskiszymon@gmail.com>2016-01-19 11:51:33 +0100
commit74c92f7c9b93415650d7d449c7d0a5de0e803b26 (patch)
tree51c82ea03395bf93d94077f1fc91da27fa0cb39b
parent22f6344e3ed90619a639258157744b4ef7db5754 (diff)
fix for closing virtual input
-rw-r--r--RtMidi.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/RtMidi.cpp b/RtMidi.cpp
index 4873d3d..4beaec9 100644
--- a/RtMidi.cpp
+++ b/RtMidi.cpp
@@ -667,11 +667,17 @@ void MidiInCore :: openVirtualPort( const std::string portName )
void MidiInCore :: 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;
}
unsigned int MidiInCore :: getPortCount()