From 90ab6dfca8783bf589952caf038072dfe3d464a3 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Wed, 1 Jun 2011 14:32:59 -0400 Subject: [PATCH] Add hack to stop random crashes on editor leave. I'm sure there is a better way, but this works right now. --- src/TimingData.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/TimingData.cpp b/src/TimingData.cpp index c26e7062b3..0f70041bc8 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -1475,8 +1475,13 @@ void TimingData::DeleteRows( int iStartRow, int iRowsToDelete ) float TimingData::GetDisplayedSpeedPercent( float fSongBeat, float fMusicSeconds ) const { + /* HACK: Somehow we get called into this function when there is no + * TimingData to work with. This seems to happen the most upon + * leaving the editor. Still, cover our butts in case this instance + * isn't existing. */ + if (!this) return 1.0f; if( m_SpeedSegments.size() == 0 ) - return 1.0; + return 1.0f; const int index = GetSpeedSegmentIndexAtBeat( fSongBeat );