From 24e3cb462e47b22edda334939123694ff6920e95 Mon Sep 17 00:00:00 2001 From: givethesourceplox Date: Fri, 30 Oct 2026 11:09:38 -0300 Subject: core: return empty perf stats before the system is running (#30) The SDL frontend's title timer can fire before perf_stats exists and crashed on its null mutex during boot. Assisted-by: Claude (Anthropic) Co-authored-by: givethesourceplox <272928635+givethesourceplox@users.noreply.github.com> --- src/core/core.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/core.cpp') diff --git a/src/core/core.cpp b/src/core/core.cpp index 3728ccf8f7..64e1d8de06 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -496,6 +496,9 @@ struct System::Impl { } PerfStatsResults GetAndResetPerfStats() { + if (!perf_stats) { + return {}; + } return perf_stats->GetAndResetStats(core_timing.GetGlobalTimeUs()); } -- cgit v1.2.3