Skip to content

Commit

Permalink
Clear unneeded variables upon stopping emulation.
Browse files Browse the repository at this point in the history
  • Loading branch information
rog9 committed Nov 24, 2012
1 parent d26c7fe commit 0c6dad6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ void Stop() // - Hammertime!
SConfig::GetInstance().m_SYSCONF->Reload();

INFO_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutdown complete ----");
Movie::g_currentInputCount = 0;
Movie::Shutdown();
g_bStopping = false;
}

Expand Down
11 changes: 7 additions & 4 deletions Source/Core/Core/Src/Movie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,6 @@ void Init()
g_currentFrame = 0;
g_currentLagCount = 0;
g_currentInputCount = 0;
// we don't clear these things because otherwise we can't resume playback if we load a movie state later
//g_totalFrames = g_totalBytes = 0;
//delete tmpInput;
//tmpInput = NULL;
}
else
std::thread md5thread(CheckMD5);
Expand Down Expand Up @@ -1186,4 +1182,11 @@ void CheckMD5()
Core::DisplayMessage("Finished calculating checksum.", 2000);
}
}

void Shutdown()
{
g_currentInputCount = g_totalInputCount = g_totalFrames = g_totalBytes = 0;
delete [] tmpInput;
tmpInput = NULL;
}
};
1 change: 1 addition & 0 deletions Source/Core/Core/Src/Movie.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ void EndPlayInput(bool cont);
void SaveRecording(const char *filename);
void DoState(PointerWrap &p);
void CheckMD5();
void Shutdown();

std::string GetInputDisplay();

Expand Down

0 comments on commit 0c6dad6

Please sign in to comment.