Skip to content

Reset static device state on core unload to ensure input descriptors …#1871

Merged
flyinghead merged 1 commit intoflyinghead:masterfrom
rtomasa:master
Mar 17, 2025
Merged

Reset static device state on core unload to ensure input descriptors …#1871
flyinghead merged 1 commit intoflyinghead:masterfrom
rtomasa:master

Conversation

@rtomasa
Copy link
Contributor

@rtomasa rtomasa commented Mar 16, 2025

Explicitly reset static variables device_type and first_run in
retro_deinit() and retro_init() to guarantee a clean state when
the core is reloaded. This fixes input descriptors not refreshing
after core reloads due to retained static values.

  • Reset device_type to {-1, -1, -1, -1 in retro_deinit()
  • Ensure first_run is reinitialized to true in retro_init()
  • Addresses platform-specific behavior where dynamic libraries may retain
    static variables even after unload (e.g., incomplete OS-level cleanup)

@flyinghead flyinghead merged commit 8b35fb8 into flyinghead:master Mar 17, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants