Don't manually delete Clip if it has a Track
This commit is contained in:
@@ -345,6 +345,7 @@ Clip * Track::addClip( Clip * clip )
|
||||
*/
|
||||
void Track::removeClip( Clip * clip )
|
||||
{
|
||||
auto guard = Engine::audioEngine()->requestChangesGuard();
|
||||
clipVector::iterator it = std::find( m_clips.begin(), m_clips.end(), clip );
|
||||
if( it != m_clips.end() )
|
||||
{
|
||||
@@ -650,4 +651,4 @@ BoolModel *Track::getMutedModel()
|
||||
return &m_mutedModel;
|
||||
}
|
||||
|
||||
} // namespace lmms
|
||||
} // namespace lmms
|
||||
|
||||
@@ -284,7 +284,8 @@ bool ClipView::close()
|
||||
/*! \brief Removes a ClipView from its track view.
|
||||
*
|
||||
* Like the close() method, this asks the track view to remove this
|
||||
* ClipView.
|
||||
* ClipView. However, the clip is
|
||||
* scheduled for later deletion rather than closed immediately.
|
||||
*
|
||||
*/
|
||||
void ClipView::remove()
|
||||
@@ -293,8 +294,15 @@ void ClipView::remove()
|
||||
|
||||
// delete ourself
|
||||
close();
|
||||
auto guard = Engine::audioEngine()->requestChangesGuard();
|
||||
delete m_clip;
|
||||
|
||||
// Since the Track would own the clip, we don't delete it
|
||||
if (m_clip->getTrack())
|
||||
{
|
||||
m_clip->getTrack()->removeClip(m_clip);
|
||||
return;
|
||||
}
|
||||
|
||||
m_clip->deleteLater();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user