Dispose stuff

This commit is contained in:
Isaac Marovitz 2023-05-19 09:27:25 -04:00 committed by Isaac Marovitz
parent 86fdd76013
commit e51c131fd7
5 changed files with 9 additions and 5 deletions

View file

@ -1,3 +1,4 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Primitives; using Avalonia.Controls.Primitives;
using Avalonia.Input; using Avalonia.Input;
@ -182,8 +183,9 @@ namespace Ryujinx.Ava.UI.Views.Input
return assigner; return assigner;
} }
public void Dispose() protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
{ {
base.OnDetachedFromVisualTree(e);
_currentAssigner?.Cancel(); _currentAssigner?.Cancel();
_currentAssigner = null; _currentAssigner = null;
} }

View file

@ -1,3 +1,4 @@
using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Primitives; using Avalonia.Controls.Primitives;
using Avalonia.Input; using Avalonia.Input;
@ -198,8 +199,9 @@ namespace Ryujinx.Ava.UI.Views.Input
return assigner; return assigner;
} }
public void Dispose() protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
{ {
base.OnDetachedFromVisualTree(e);
_currentAssigner?.Cancel(); _currentAssigner?.Cancel();
_currentAssigner = null; _currentAssigner = null;
} }

View file

@ -29,7 +29,7 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<views:InputView <views:InputView
Grid.Row="0" Grid.Row="0"
Name="ControllerSettings" /> Name="InputView" />
<StackPanel <StackPanel
Orientation="Vertical" Orientation="Vertical"
Grid.Row="2"> Grid.Row="2">

View file

@ -11,7 +11,7 @@ namespace Ryujinx.Ava.UI.Views.Settings
public void Dispose() public void Dispose()
{ {
ControllerSettings.Dispose(); InputView.Dispose();
} }
} }
} }

View file

@ -37,7 +37,7 @@ namespace Ryujinx.Ava.UI.Windows
public void SaveSettings() public void SaveSettings()
{ {
InputPage.ControllerSettings?.SaveCurrentProfile(); InputPage.InputView?.SaveCurrentProfile();
if (Owner is MainWindow window && ViewModel.DirectoryChanged) if (Owner is MainWindow window && ViewModel.DirectoryChanged)
{ {