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.
| 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. |
| 106 | void 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 | |
| 120 | void ProjectHistory::SetStateTo(int n, bool doAutosave) |
| 121 | { |
no test coverage detected