1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-15 09:01:12 +01:00

RAII for locking the all-projects mutex

This commit is contained in:
Paul Licameli
2016-08-02 22:07:20 -04:00
parent cfd7648fce
commit 186679b3a6
5 changed files with 16 additions and 41 deletions

View File

@@ -339,7 +339,6 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
// Other commands
static TrackList *GetClipboardTracks();
static void DeleteClipboard();
static void DeleteAllProjectsDeleteLock();
// checkActive is a temporary hack that should be removed as soon as we
// get multiple effect preview working
@@ -514,10 +513,6 @@ public:
bool TryToMakeActionAllowed
( CommandFlag & flags, CommandFlag flagsRqd, CommandFlag mask );
///Prevents DELETE from external thread - for e.g. use of GetActiveProject
static void AllProjectsDeleteLock();
static void AllProjectsDeleteUnlock();
void PushState(const wxString &desc, const wxString &shortDesc); // use UndoPush::AUTOSAVE
void PushState(const wxString &desc, const wxString &shortDesc, UndoPush flags);
void RollbackState();
@@ -577,9 +572,12 @@ public:
static double msClipT0;
static double msClipT1;
public:
///Prevents DELETE from external thread - for e.g. use of GetActiveProject
//shared by all projects
static ODLock *msAllProjectDeleteMutex;
static ODLock &AllProjectDeleteMutex();
private:
// History/Undo manager
std::unique_ptr<UndoManager> mUndoManager;
bool mDirty{ false };