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

View file

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

View file

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