Skip to content

Commit

Permalink
Fix detuning crash after deleting the note being edited (#4324)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhysSong authored Apr 30, 2018
1 parent 84d3c93 commit 08573fc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <QLayout>
#include <QMdiArea>
#include <QPainter>
#include <QPointer>
#include <QScrollBar>
#include <QStyleOption>
#include <QSignalMapper>
Expand Down Expand Up @@ -1334,8 +1335,8 @@ void PianoRoll::mousePressEvent(QMouseEvent * me )

if( m_editMode == ModeEditDetuning && noteUnderMouse() )
{
static AutomationPattern* detuningPattern = nullptr;
if (detuningPattern != nullptr)
static QPointer<AutomationPattern> detuningPattern = nullptr;
if (detuningPattern.data() != nullptr)
{
detuningPattern->disconnect(this);
}
Expand All @@ -1345,7 +1346,7 @@ void PianoRoll::mousePressEvent(QMouseEvent * me )
n->createDetuning();
}
detuningPattern = n->detuning()->automationPattern();
connect(detuningPattern, SIGNAL(dataChanged()), this, SLOT(update()));
connect(detuningPattern.data(), SIGNAL(dataChanged()), this, SLOT(update()));
gui->automationEditor()->open(detuningPattern);
return;
}
Expand Down

0 comments on commit 08573fc

Please sign in to comment.