Skip to content

Commit

Permalink
fix variable editor memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
akeshet committed Sep 16, 2012
1 parent 20982ac commit 21fab32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion WordGenerator/Controls/VariablesTab/VariableEditor.cs
Expand Up @@ -209,7 +209,7 @@ private void attemptDeleteVariable()
}
}

private void button1_Click(object sender, EventArgs e)
private void deleteVariableButtonClick(object sender, EventArgs e)
{
attemptDeleteVariable();
}
Expand Down
2 changes: 2 additions & 0 deletions WordGenerator/Controls/VariablesTab/VariablesAndListPage.cs
Expand Up @@ -141,6 +141,7 @@ private void layoutVariables()
for (int i = 0; i < extras; i++)
{
variablesPanel.Controls.Remove(variableEditors[0]);
variableEditors[0].Dispose();
variableEditors.RemoveAt(0);
}
}
Expand Down Expand Up @@ -226,6 +227,7 @@ void ved_variableDeleted(object sender, EventArgs e)
// if we know which specific editor it was
variableEditors.Remove(ved);
variablesPanel.Controls.Remove(ved);
ved.Dispose();

}
else
Expand Down

0 comments on commit 21fab32

Please sign in to comment.