timeline: refactored "replace with gap" command fixed bug
Fixes an unfortunate bug that restored blocks in the wrong order and leads to a segfault if you continue undoing beyond that point.
This commit is contained in:
@@ -483,6 +483,12 @@ void TimelineWidget::ReplaceBlocksWithGaps(const QList<Block *> &blocks,
|
||||
QUndoCommand *command)
|
||||
{
|
||||
foreach (Block* b, blocks) {
|
||||
if (b->type() == Block::kGap) {
|
||||
// No point in replacing a gap with a gap, and TrackReplaceBlockWithGapCommand will clear
|
||||
// up any extraneous gaps
|
||||
continue;
|
||||
}
|
||||
|
||||
TrackOutput* original_track = TrackOutput::TrackFromBlock(b);
|
||||
|
||||
new TrackReplaceBlockWithGapCommand(original_track, b, command);
|
||||
|
||||
Reference in New Issue
Block a user