Skip to content

Commit

Permalink
NavigationForm: fix crash on re-opening
Browse files Browse the repository at this point in the history
- maybe there's better ways but to fix we intercept Close() events, cancel, and Hide() instead
- fixes #92
  • Loading branch information
binary1230 committed Nov 21, 2023
1 parent 3c1f8bf commit 9a0b345
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions DiztinGUIsh/window/NavigationForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ public ISnesNavigation SnesNavigation
public NavigationForm()
{
InitializeComponent();
FormClosing += Navigation_Closing;
}

private void Navigation_Closing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason != CloseReason.UserClosing)
return;

e.Cancel = true;
Hide();
}

private void Navigation_Load(object sender, EventArgs e)
Expand Down

0 comments on commit 9a0b345

Please sign in to comment.