diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 3162d18534..83cc2a4474 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -613,6 +613,9 @@ void ScreenEdit::Init() ScreenEdit::~ScreenEdit() { + // UGLY: Don't delete the Song's steps. + m_songLastSave.DetachSteps(); + LOG->Trace( "ScreenEdit::~ScreenEdit()" ); m_soundMusic.StopPlaying(); } diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index cf3d5469b2..f214b29193 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -85,6 +85,13 @@ Song::~Song() // that all pointers to this Song and its Steps are invalidated. } +void Song::DetachSteps() +{ + m_vpSteps.clear(); + FOREACH_StepsType( st ) + m_vpStepsByType[st].clear(); +} + /* Reset to an empty song. */ void Song::Reset() { diff --git a/stepmania/src/song.h b/stepmania/src/song.h index 457be50613..736f58f73f 100644 --- a/stepmania/src/song.h +++ b/stepmania/src/song.h @@ -59,6 +59,7 @@ public: Song(); ~Song(); void Reset(); + void DetachSteps(); NotesLoader *MakeLoader( CString sDir ) const;