1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-01-12 07:35:51 +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,12 +229,16 @@ 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);
mDirManager->Deref(pOldSeqBlock->f); if (!pOldSeqBlock->f->IsAlias())
pOldSeqBlock->f = NULL; //vvvvv ...so we don't delete the file when we delete mBlock, next. ANSWER-ME: Right, or delete? {
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?
}
} }
delete mBlock; delete mBlock;