mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-08-17 07:47:23 -05:00
Use the normal state changed `HookableEvent` instead of having `Core::NotifyStateChanged` call `g_perf_metrics.OnEmulationStateChanged` directly. The direct call was added inbad78cfed4to avoid a crash. At the time state changed callbacks were stored in a vector, and the crash was caused by `g_perf_metric`'s destructor trying to remove the callback from the already-destroyed vector. Latera97627e736switched state changed callbacks to use `HookableEvent`, which is specifically designed to handle the case where a hook outlives its associated event. Since the workaround is no longer necessary replace it with a standard `EventHook`.