From 85406584e5207501912be5c2185ba11c3a1440f7 Mon Sep 17 00:00:00 2001 From: BlackBearReloaded Date: Fri, 2 Oct 2026 12:05:08 -0400 Subject: [PATCH] The shutdown check covers the cheat engine: destroyed before the services close --- headless/check_audio_shutdown.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/headless/check_audio_shutdown.py b/headless/check_audio_shutdown.py index 4ce5765..1573339 100644 --- a/headless/check_audio_shutdown.py +++ b/headless/check_audio_shutdown.py @@ -13,16 +13,20 @@ def check(text): assert all(body.count(step) == 1 for step in steps) offsets = [body.index(step) for step in steps] assert offsets == sorted(offsets), 'Audio callbacks outlive service owners' + # The cheat engine's timer callback asks the service manager for HID: it is destroyed first. + assert body.index('cheat_engine.reset();') < body.index('kernel.CloseServices();'), \ + 'The cheat engine outlives the services' if __name__ == '__main__': fixed, original = (Path(name).read_text() for name in sys.argv[1:]) check(fixed) for bad in (original, fixed.replace('GameSettings::LoadOverrides(params.program_id,', 'GameSettings::LoadOverrides(program_id,'), fixed.replace('if (audio_core) audio_core->Shutdown();', '').replace( - 'services.reset();', 'services.reset();\nif (audio_core) audio_core->Shutdown();')): + 'services.reset();', 'services.reset();\nif (audio_core) audio_core->Shutdown();'), + fixed.replace(' cheat_engine.reset();\n', '', 1)): try: check(bad) except AssertionError: continue - raise AssertionError('Accepted missing or late audio worker shutdown') - print('Resolved program ID and early audio shutdown coexist; rejection controls PASS') + raise AssertionError('Accepted missing or late audio worker shutdown, or a late cheat engine') + print('Resolved program ID, early audio shutdown and early cheat engine teardown; rejection controls PASS')