mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-21 14:02:57 +02:00
Bug1829, more: check all errors flushing and closing export files...
... MP3 export already did this, the other five needed work.
This commit is contained in:
@@ -209,10 +209,17 @@ int ufile_close(AVIOContext *pb)
|
||||
{
|
||||
std::unique_ptr<wxFile> f{ (wxFile *)pb->opaque };
|
||||
|
||||
if (f)
|
||||
f->Close();
|
||||
bool success = true;
|
||||
if (f) {
|
||||
success = f->Flush() && f->Close();
|
||||
pb->opaque = nullptr;
|
||||
}
|
||||
|
||||
return 0;
|
||||
// We're not certain that a close error is for want of space, but we'll
|
||||
// guess that
|
||||
return success ? 0 : -ENOSPC;
|
||||
|
||||
// Implicitly destroy the wxFile object here
|
||||
}
|
||||
|
||||
// Open a file with a (possibly) Unicode filename
|
||||
|
Reference in New Issue
Block a user