Fix heap-use-after-free in Track::loadSettings

This commit is contained in:
sakertooth
2023-09-08 14:07:17 -04:00
parent d5bf069624
commit f5615b4059

View File

@@ -290,11 +290,7 @@ void Track::loadSettings( const QDomElement & element )
return;
}
while( !m_clips.empty() )
{
delete m_clips.front();
// m_clips.erase( m_clips.begin() );
}
deleteClips();
QDomNode node = element.firstChild();
while( !node.isNull() )
@@ -365,6 +361,7 @@ void Track::removeClip( Clip * clip )
/*! \brief Remove all Clips from this track */
void Track::deleteClips()
{
auto guard = Engine::audioEngine()->requestChangesGuard();
while (!m_clips.empty())
{
delete m_clips.front();