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
This commit is contained in:
Andy Adshead 2019-01-30 08:15:44 +00:00
commit 9380873764
3 changed files with 10 additions and 8 deletions

View file

@ -209,6 +209,12 @@ namespace Ryujinx.Profiler.UI
/// <remarks>There is no need to call the base implementation.</remarks> /// <remarks>There is no need to call the base implementation.</remarks>
public void Update(FrameEventArgs e) public void Update(FrameEventArgs e)
{ {
if (_visibleChanged)
{
Visible = _visible;
_visibleChanged = false;
}
// Backspace handling // Backspace handling
if (_backspaceDown) if (_backspaceDown)
{ {
@ -322,12 +328,6 @@ namespace Ryujinx.Profiler.UI
/// <remarks>There is no need to call the base implementation.</remarks> /// <remarks>There is no need to call the base implementation.</remarks>
public void Draw() public void Draw()
{ {
if (_visibleChanged)
{
Visible = _visible;
_visibleChanged = false;
}
if (!_visible || !_initComplete) if (!_visible || !_initComplete)
{ {
return; return;

View file

@ -43,8 +43,6 @@ namespace Ryujinx.Profiler.UI
_window.Dispose(); _window.Dispose();
} }
_profileThread.Join();
_window = null; _window = null;
} }

View file

@ -287,6 +287,10 @@ namespace Ryujinx
protected override void OnUnload(EventArgs e) protected override void OnUnload(EventArgs e)
{ {
#if USE_PROFILING
_profileWindow.Close();
#endif
_renderThread.Join(); _renderThread.Join();
base.OnUnload(e); base.OnUnload(e);