Merge pull request #2977 from jasp00/delete-track

Request change in model when deleting a track
This commit is contained in:
Javier Serrano Polo
2016-08-18 20:22:34 +00:00
committed by GitHub
2 changed files with 6 additions and 6 deletions

View File

@@ -22,6 +22,8 @@
*
*/
#include "TrackContainerView.h"
#include <algorithm>
#include <QApplication>
@@ -32,10 +34,10 @@
#include <QWheelEvent>
#include "TrackContainerView.h"
#include "TrackContainer.h"
#include "BBTrack.h"
#include "MainWindow.h"
#include "Mixer.h"
#include "debug.h"
#include "FileBrowser.h"
#include "ImportFilter.h"
@@ -271,7 +273,9 @@ void TrackContainerView::deleteTrackView( TrackView * _tv )
removeTrackView( _tv );
delete _tv;
t->deleteLater();
Engine::mixer()->requestChangeInModel();
delete t;
Engine::mixer()->doneChangeInModel();
}

View File

@@ -155,15 +155,11 @@ int InstrumentTrack::baseNote() const
InstrumentTrack::~InstrumentTrack()
{
Engine::mixer()->requestChangeInModel();
// kill all running notes and the iph
silenceAllNotes( true );
// now we're save deleting the instrument
if( m_instrument ) delete m_instrument;
Engine::mixer()->doneChangeInModel();
}