MCPcopy Create free account
hub / github.com/audacity/audacity / PopState

Method PopState

libraries/lib-project-history/ProjectHistory.cpp:106–118  ·  view source on GitHub ↗

LL: Is there a memory leak here as "l" and "t" are not deleted??? Vaughan, 2010-08-29: No, as "l" is a TrackList* of an Undo stack state. Need to keep it and its tracks "t" available for Undo/Redo/SetStateTo.

Source from the content-addressed store, hash-verified

104// Vaughan, 2010-08-29: No, as "l" is a TrackList* of an Undo stack state.
105// Need to keep it and its tracks "t" available for Undo/Redo/SetStateTo.
106void ProjectHistory::PopState(const UndoState &state, bool doAutosave)
107{
108 auto &project = mProject;
109 if (doAutosave)
110 AutoSave::Call(project);
111
112 // remaining no-fail operations "commit" the changes of undo manager state
113
114 // Restore extra state
115 for (auto &pExtension : state.extensions)
116 if (pExtension)
117 pExtension->RestoreUndoRedoState(project);
118}
119
120void ProjectHistory::SetStateTo(int n, bool doAutosave)
121{

Callers 6

ApplyMacroMethod · 0.80
OnUndoFunction · 0.80
OnRedoFunction · 0.80
undoMethod · 0.80
redoMethod · 0.80
undoUnsavedMethod · 0.80

Calls 2

CallClass · 0.85
RestoreUndoRedoStateMethod · 0.45

Tested by

no test coverage detected