From 938087376403be84a377dafe29626bdc4245f37e Mon Sep 17 00:00:00 2001 From: Andy Adshead Date: Wed, 30 Jan 2019 08:15:44 +0000 Subject: [PATCH] Move visible update to update rather than draw as it causes a lockup if called from draw Also added profile window disposal so closing main window closes profiler too --- Ryujinx.Profiler/UI/ProfileWindow.cs | 12 ++++++------ Ryujinx.Profiler/UI/ProfileWindowManager.cs | 2 -- Ryujinx/Ui/GLScreen.cs | 4 ++++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Ryujinx.Profiler/UI/ProfileWindow.cs b/Ryujinx.Profiler/UI/ProfileWindow.cs index ec65d5f450..1302158c02 100644 --- a/Ryujinx.Profiler/UI/ProfileWindow.cs +++ b/Ryujinx.Profiler/UI/ProfileWindow.cs @@ -209,6 +209,12 @@ namespace Ryujinx.Profiler.UI /// There is no need to call the base implementation. public void Update(FrameEventArgs e) { + if (_visibleChanged) + { + Visible = _visible; + _visibleChanged = false; + } + // Backspace handling if (_backspaceDown) { @@ -322,12 +328,6 @@ namespace Ryujinx.Profiler.UI /// There is no need to call the base implementation. public void Draw() { - if (_visibleChanged) - { - Visible = _visible; - _visibleChanged = false; - } - if (!_visible || !_initComplete) { return; diff --git a/Ryujinx.Profiler/UI/ProfileWindowManager.cs b/Ryujinx.Profiler/UI/ProfileWindowManager.cs index e20c64b196..da6b94253a 100644 --- a/Ryujinx.Profiler/UI/ProfileWindowManager.cs +++ b/Ryujinx.Profiler/UI/ProfileWindowManager.cs @@ -43,8 +43,6 @@ namespace Ryujinx.Profiler.UI _window.Dispose(); } - _profileThread.Join(); - _window = null; } diff --git a/Ryujinx/Ui/GLScreen.cs b/Ryujinx/Ui/GLScreen.cs index 4cbbaf9a30..0f89fa9fa5 100644 --- a/Ryujinx/Ui/GLScreen.cs +++ b/Ryujinx/Ui/GLScreen.cs @@ -287,6 +287,10 @@ namespace Ryujinx protected override void OnUnload(EventArgs e) { + #if USE_PROFILING + _profileWindow.Close(); + #endif + _renderThread.Join(); base.OnUnload(e);