Skip to content

Commit

Permalink
grab LanguageKey before dispose (#1661)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencohn authored Nov 6, 2024
1 parent 8999258 commit 63dd62a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion OneMore/Commands/Edit/ChooseColorizerCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace River.OneMoreAddIn.Commands
internal class ChooseColorizerCommand : Command
{
private ColorizeDialog dialog;
private string key;


public ChooseColorizerCommand()
Expand All @@ -32,7 +33,6 @@ public override async Task Execute(params object[] args)

if (dialog.ShowDialog(owner) == DialogResult.OK)
{
var key = dialog.LanguageKey;
if (key != null)
{
await factory.Run<ColorizeCommand>(key);
Expand All @@ -45,6 +45,7 @@ private void Dialog_FormClosed(object sender, FormClosedEventArgs e)
{
if (dialog != null)
{
key = dialog.LanguageKey;
dialog.FormClosed -= Dialog_FormClosed;
dialog.Dispose();
dialog = null;
Expand Down

0 comments on commit 63dd62a

Please sign in to comment.