From 6cd69076d06994b28df2e8212e7dba778a54c619 Mon Sep 17 00:00:00 2001 From: Andy Adshead Date: Sat, 16 Feb 2019 04:15:37 +0000 Subject: [PATCH] Fiked small bug caused by race condition --- Ryujinx.Profiler/UI/ProfileWindow.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Ryujinx.Profiler/UI/ProfileWindow.cs b/Ryujinx.Profiler/UI/ProfileWindow.cs index b13e7b8da4..ae7f5ffa5e 100644 --- a/Ryujinx.Profiler/UI/ProfileWindow.cs +++ b/Ryujinx.Profiler/UI/ProfileWindow.cs @@ -238,12 +238,17 @@ namespace Ryujinx.Profiler.UI _updateTimer += e.Time; if (_doStep || ((Profile.UpdateRate > 0) && (!_paused && (_updateTimer > Profile.UpdateRate)))) { - _updateTimer = 0; - _unsortedProfileData = Profile.GetProfilingData().ToList(); - _captureTime = PerformanceCounter.ElapsedTicks; - _timingFlags = Profile.GetTimingFlags(); - _profileUpdated = true; - _doStep = false; + _updateTimer = 0; + _captureTime = PerformanceCounter.ElapsedTicks; + _timingFlags = Profile.GetTimingFlags(); + _doStep = false; + + Dictionary data = Profile.GetProfilingData(); + if (data.Count > 0) + { + _unsortedProfileData = data.ToList(); + _profileUpdated = true; + } } // Filtering