Skip to content

Commit

Permalink
grab LanguageKey before dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencohn committed Nov 6, 2024
1 parent 8999258 commit ee0020e
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 ee0020e

Please sign in to comment.