Android: Fix ANR when boot fails

This commit is contained in:
Connor McLaughlin 2020-10-10 16:35:36 +10:00
parent 897f2dadf8
commit 423054e8ac
2 changed files with 4 additions and 1 deletions

View file

@ -194,7 +194,9 @@ void AndroidHostInterface::PauseEmulationThread(bool paused)
void AndroidHostInterface::StopEmulationThread()
{
Assert(IsEmulationThreadRunning());
if (!IsEmulationThreadRunning())
return;
Log_InfoPrint("Stopping emulation thread...");
{
std::unique_lock<std::mutex> lock(m_mutex);

View file

@ -100,6 +100,7 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
public void onEmulationStopped() {
runOnUiThread(() -> {
AndroidHostInterface.getInstance().stopEmulationThread();
if (!mWasDestroyed)
finish();
});