mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-22 23:30:07 +02:00
Fix assertions on project close about mis-estimated block count
This commit is contained in:
parent
98d8603931
commit
b32ce8ab21
@ -185,7 +185,10 @@ size_t UndoManager::EstimateRemovedBlocks(size_t begin, size_t end)
|
||||
|
||||
// Collect ids that won't survive (and are not negative pseudo ids)
|
||||
SampleBlockIDSet seen, mayDelete;
|
||||
std::for_each( first + begin, first + end, [&](const auto &p){
|
||||
for( auto ii = begin; ii < end; ++ii) {
|
||||
if (ii == saved)
|
||||
continue;
|
||||
auto &p = *(first + ii);
|
||||
auto &tracks = *p->state.tracks;
|
||||
InspectBlocks(tracks, [&]( const SampleBlock &block ){
|
||||
auto id = block.GetBlockID();
|
||||
@ -193,7 +196,7 @@ size_t UndoManager::EstimateRemovedBlocks(size_t begin, size_t end)
|
||||
mayDelete.insert( id );
|
||||
},
|
||||
&seen);
|
||||
} );
|
||||
}
|
||||
return mayDelete.size();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user