1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-01-12 23:55:50 +01:00

fix for P1 "repeatable crash set format to 16-bit..." thread

This commit is contained in:
v.audacity
2012-02-29 04:16:08 +00:00
parent 1f688cfb85
commit c699aa601d

View File

@@ -229,13 +229,17 @@ bool Sequence::ConvertToSampleFormat(sampleFormat format, bool* pbChanged)
if (bSuccess) if (bSuccess)
{ {
// Invalidate all the old block files. // Invalidate all the old, non-aliased block files.
// Aliased files will be converted at save, per comment above.
for (size_t i = 0; (i < mBlock->GetCount() && bSuccess); i++) for (size_t i = 0; (i < mBlock->GetCount() && bSuccess); i++)
{ {
SeqBlock* pOldSeqBlock = mBlock->Item(i); SeqBlock* pOldSeqBlock = mBlock->Item(i);
if (!pOldSeqBlock->f->IsAlias())
{
mDirManager->Deref(pOldSeqBlock->f); mDirManager->Deref(pOldSeqBlock->f);
pOldSeqBlock->f = NULL; //vvvvv ...so we don't delete the file when we delete mBlock, next. ANSWER-ME: Right, or delete? pOldSeqBlock->f = NULL; //vvvvv ...so we don't delete the file when we delete mBlock, next. ANSWER-ME: Right, or delete?
} }
}
delete mBlock; delete mBlock;
// Replace with new blocks. // Replace with new blocks.