Merge pull request #4689 from leoetlino/check-events

Only allow reset/power when core is running
This commit is contained in:
Matthew Parlane 2017-01-20 10:59:39 +13:00 committed by GitHub
commit 9d792f7fe6
1 changed files with 4 additions and 0 deletions

View File

@ -230,6 +230,8 @@ static void IOSNotifyPowerButtonCallback(u64 userdata, s64 cyclesLate)
void ResetButton_Tap() void ResetButton_Tap()
{ {
if (!Core::IsRunning())
return;
CoreTiming::ScheduleEvent(0, toggleResetButton, true, CoreTiming::FromThread::ANY); CoreTiming::ScheduleEvent(0, toggleResetButton, true, CoreTiming::FromThread::ANY);
CoreTiming::ScheduleEvent(0, iosNotifyResetButton, 0, CoreTiming::FromThread::ANY); CoreTiming::ScheduleEvent(0, iosNotifyResetButton, 0, CoreTiming::FromThread::ANY);
CoreTiming::ScheduleEvent(SystemTimers::GetTicksPerSecond() / 2, toggleResetButton, false, CoreTiming::ScheduleEvent(SystemTimers::GetTicksPerSecond() / 2, toggleResetButton, false,
@ -238,6 +240,8 @@ void ResetButton_Tap()
void PowerButton_Tap() void PowerButton_Tap()
{ {
if (!Core::IsRunning())
return;
CoreTiming::ScheduleEvent(0, iosNotifyPowerButton, 0, CoreTiming::FromThread::ANY); CoreTiming::ScheduleEvent(0, iosNotifyPowerButton, 0, CoreTiming::FromThread::ANY);
} }