From 1634391bff225e56134ee925852f4344c4a7b11b Mon Sep 17 00:00:00 2001
From: Charles Lombardo <clombardo169@gmail.com>
Date: Tue, 21 Mar 2023 21:23:10 -0400
Subject: [PATCH] android: Stop updating fps counter when emulation stops

---
 .../java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
index 37469302d5..c02d35f5d7 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
@@ -168,7 +168,10 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
                 if (perfStats[FPS] > 0) {
                     binding.showFpsText.text = String.format("FPS: %.1f", perfStats[FPS])
                 }
-                perfStatsUpdateHandler.postDelayed(perfStatsUpdater!!, 100)
+
+                if (!emulationState.isStopped) {
+                    perfStatsUpdateHandler.postDelayed(perfStatsUpdater!!, 100)
+                }
             }
             perfStatsUpdateHandler.post(perfStatsUpdater!!)
             binding.showFpsText.visibility = View.VISIBLE