Fixing the leak in calendar mmode.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
xmlns:viewModels="using:Wino.Calendar.ViewModels.Data"
|
||||
x:Name="Root"
|
||||
SizeChanged="ControlSizeChanged"
|
||||
Unloaded="ControlUnloaded"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
|
||||
@@ -324,6 +324,13 @@ public sealed partial class CalendarPeriodControl : UserControl, INotifyProperty
|
||||
});
|
||||
}
|
||||
|
||||
private void ControlUnloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DetachCurrentItemsSource();
|
||||
_sizeRefreshTimer.Stop();
|
||||
_sizeRefreshTimer.Tick -= SizeRefreshTimerTick;
|
||||
}
|
||||
|
||||
private void SizeRefreshTimerTick(DispatcherQueueTimer sender, object args)
|
||||
{
|
||||
sender.Stop();
|
||||
|
||||
@@ -52,6 +52,12 @@ public sealed partial class CalendarPage : CalendarPageAbstract, ITitleBarSearch
|
||||
base.OnNavigatingFrom(e);
|
||||
}
|
||||
|
||||
public override void PrepareForClose()
|
||||
{
|
||||
DetachNavigationLifetimeEvents();
|
||||
base.PrepareForClose();
|
||||
}
|
||||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
@@ -168,6 +168,8 @@ public sealed partial class WinoAppShell : Views.Abstract.WinoAppShellAbstract,
|
||||
{
|
||||
ViewModel.StatePersistenceService.IsEventDetailsVisible = false;
|
||||
ViewModel.CalendarClient.Deactivate();
|
||||
WindowCleanupHelper.CleanupFrame(InnerShellFrame);
|
||||
GC.Collect();
|
||||
}
|
||||
else if (_activeMode == WinoApplicationMode.Contacts)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user