diff options
| author | Kevin Sawicki | 2011-04-05 22:34:47 +0000 |
|---|---|---|
| committer | Matthias Sohn | 2011-04-05 22:34:47 +0000 |
| commit | 0ee4c7f4c9cb3e20adc204bfc1063e089193960c (patch) | |
| tree | aa2f57daa20af711ac78aab5a35d84ea47c0fe8d | |
| parent | 17909ae55052a0856ff7c2a1627bbef5426dce0e (diff) | |
| download | egit-0ee4c7f4c9cb3e20adc204bfc1063e089193960c.tar.gz egit-0ee4c7f4c9cb3e20adc204bfc1063e089193960c.tar.xz egit-0ee4c7f4c9cb3e20adc204bfc1063e089193960c.zip | |
Remove execution listener in finally block
... for delete command in the branch selection dialog.
Previously the listener on the delete command wasn't being
removed after execution which could cause widget is disposed
exceptions when the branch selection dialog was opened multiple
times.
Bug: 339184
Change-Id: I8f7518294d0454ce58e207f9726c12859a6eb8cf
Signed-off-by: Kevin Sawicki <kevin@github.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| -rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java index ff6a9a5aca..9557e60c49 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionDialog.java @@ -179,7 +179,7 @@ public class BranchSelectionDialog extends AbstractBranchSelectionDialog { Command deleteCommand = commandService .getCommand("org.eclipse.egit.ui.RepositoriesViewDeleteBranch"); //$NON-NLS-1$ - deleteCommand.addExecutionListener(new IExecutionListener() { + IExecutionListener deleteListener = new IExecutionListener() { public void preExecute(String commandId, ExecutionEvent event) { /* do nothing */ } @@ -193,11 +193,12 @@ public class BranchSelectionDialog extends AbstractBranchSelectionDialog { public void notHandled(String commandId, NotHandledException exception) { /* do nothing */ } - }); + }; // launch deleteCommand ExecutionEvent executionEvent = hsr.createExecutionEvent( deleteCommand, null); + deleteCommand.addExecutionListener(deleteListener); try { deleteCommand.executeWithChecks(executionEvent); } catch (Throwable e) { @@ -205,6 +206,8 @@ public class BranchSelectionDialog extends AbstractBranchSelectionDialog { e, UIText.BranchSelectionDialog_ErrorCouldNotDeleteRef, refNameFromDialog()); + } finally { + deleteCommand.removeExecutionListener(deleteListener); } } }); |
