Proposed fix for 1352 Instrument crash on loading
This commit is contained in:
@@ -47,6 +47,9 @@
|
||||
#include "Track.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TrackContainerView::TrackContainerView( TrackContainer * _tc ) :
|
||||
QWidget(),
|
||||
ModelView( NULL, this ),
|
||||
@@ -325,7 +328,8 @@ void TrackContainerView::dropEvent( QDropEvent * _de )
|
||||
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
|
||||
Track::create( Track::InstrumentTrack,
|
||||
m_tc ) );
|
||||
it->loadInstrument( value );
|
||||
InstrumentLoaderThread *ilt = new InstrumentLoaderThread( this, it, value);
|
||||
ilt->start();
|
||||
//it->toggledInstrumentTrackButton( true );
|
||||
_de->accept();
|
||||
}
|
||||
@@ -450,6 +454,19 @@ void TrackContainerView::scrollArea::wheelEvent( QWheelEvent * _we )
|
||||
}
|
||||
}
|
||||
|
||||
InstrumentLoaderThread::InstrumentLoaderThread( QObject *parent, InstrumentTrack *it, QString name) : QThread( parent )
|
||||
{
|
||||
m_it = it;
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
void InstrumentLoaderThread::run()
|
||||
{
|
||||
m_it->loadInstrument( m_name );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user