mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-02 17:23:18 +02:00
In case save of new project fails, clean up the _data directory
This commit is contained in:
parent
cbfde23e42
commit
8a762f95b6
@ -496,10 +496,15 @@ bool DirManager::SetProject(wxString& newProjPath, wxString& newProjName, const
|
||||
wxString cleanupLoc1=oldLoc;
|
||||
wxString cleanupLoc2=projFull;
|
||||
|
||||
bool created = false;
|
||||
|
||||
if (bCreate) {
|
||||
if (!wxDirExists(projFull))
|
||||
if (!wxDirExists(projFull)) {
|
||||
if (!wxMkdir(projFull))
|
||||
return false;
|
||||
else
|
||||
created = true;
|
||||
}
|
||||
|
||||
#ifdef __UNIX__
|
||||
chmod(OSFILENAME(projFull), 0775);
|
||||
@ -584,6 +589,14 @@ bool DirManager::SetProject(wxString& newProjPath, wxString& newProjName, const
|
||||
this->projPath = oldPath;
|
||||
this->projName = oldName;
|
||||
|
||||
if (created)
|
||||
CleanDir(
|
||||
cleanupLoc2,
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
_("Cleaning up after failed save"),
|
||||
kCleanTopDirToo);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user