Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash on exit from MIDI connections #4340

Merged
merged 1 commit into from
May 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/MidiPort.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ class MidiPort : public Model, public SerializingObject
return m_writablePorts;
}

void invalidateCilent();

MidiPortMenu* m_readablePortsMenu;
MidiPortMenu* m_writablePortsMenu;

Expand Down
4 changes: 4 additions & 0 deletions src/core/midi/MidiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ MidiClient::MidiClient()
MidiClient::~MidiClient()
{
//TODO: noteOffAll(); / clear all ports
for (MidiPort* port : m_midiPorts)
{
port->invalidateCilent();
}
}


Expand Down
8 changes: 7 additions & 1 deletion src/core/midi/MidiPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@

#include "MidiPort.h"
#include "MidiClient.h"
#include "MidiDummy.h"
#include "Note.h"
#include "Song.h"

static MidiDummy s_dummyClient;



MidiPort::MidiPort( const QString& name,
Expand Down Expand Up @@ -410,4 +413,7 @@ void MidiPort::updateOutputProgram()




void MidiPort::invalidateCilent()
{
m_midiClient = &s_dummyClient;
}