Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zeusongit committed Nov 29, 2023
1 parent e936747 commit 3b6f454
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/DynamoCore/Models/DynamoModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,11 @@ public void Dispose()
{
SearchModel.ItemProduced -= SearchModel_ItemProduced;
}
//handle the disposal of IDSDK manager instance for sandbox
if(AuthenticationManager.AuthProvider is IDSDKManager)
{
(AuthenticationManager.AuthProvider as IDSDKManager).Dispose();
}
}

private void InitializeCustomNodeManager()
Expand Down
11 changes: 6 additions & 5 deletions src/DynamoCoreWpf/Controls/ShortcutToolbar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Dynamo.UI.Controls
/// <summary>
/// An object which provides the data for the shortcut toolbar.
/// </summary>
public partial class ShortcutToolbar : UserControl
public partial class ShortcutToolbar : UserControl, IDisposable
{
private readonly ObservableCollection<ShortcutBarItem> shortcutBarItems;
private readonly ObservableCollection<ShortcutBarItem> shortcutBarRightSideItems;
Expand Down Expand Up @@ -65,7 +65,6 @@ public ShortcutToolbar(DynamoViewModel dynamoViewModel)
}

this.Loaded += ShortcutToolbar_Loaded;
this.Unloaded += ShortcutToolbar_Unloaded;
}

private void ShortcutToolbar_Loaded(object sender, RoutedEventArgs e)
Expand All @@ -75,11 +74,13 @@ private void ShortcutToolbar_Loaded(object sender, RoutedEventArgs e)
DynamoViewModel.OnRequestShorcutToolbarLoaded(RightMenu.ActualWidth);
}

private void ShortcutToolbar_Unloaded(object sender, RoutedEventArgs e)
public void Dispose()
{
authManager.LoginStateChanged -= AuthChangeHandler;
if(authManager != null)
{
authManager.LoginStateChanged -= AuthChangeHandler;
}
this.Loaded -= ShortcutToolbar_Loaded;
this.Unloaded -= ShortcutToolbar_Unloaded;
}

private void AuthChangeHandler(LoginState status)
Expand Down
1 change: 1 addition & 0 deletions src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2963,6 +2963,7 @@ public void Dispose()

// Removing the tab items list handler
dynamoViewModel.SideBarTabItems.CollectionChanged -= this.OnCollectionChanged;
shortcutBar?.Dispose();

if (fileTrustWarningPopup != null)
{
Expand Down
3 changes: 1 addition & 2 deletions src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,7 @@ internal async void HandleSignInStatusChange(bool status)
{
if (webView?.CoreWebView2 != null)
{
await webView.CoreWebView2.ExecuteScriptAsync("window.handleSignInStateChange({" +
$"status: \"" + status + "\"})");
await webView.CoreWebView2.ExecuteScriptAsync($"window.handleSignInStateChange({{\"status\": \"{status}\"}})");
}
}

Expand Down

0 comments on commit 3b6f454

Please sign in to comment.