summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-05 18:34:47 (EDT)
committer Matthias Sohn2011-04-05 18:34:47 (EDT)
commit0ee4c7f4c9cb3e20adc204bfc1063e089193960c (patch)
treeaa2f57daa20af711ac78aab5a35d84ea47c0fe8d
parent17909ae55052a0856ff7c2a1627bbef5426dce0e (diff)
downloadegit-0ee4c7f4c9cb3e20adc204bfc1063e089193960c.zip
egit-0ee4c7f4c9cb3e20adc204bfc1063e089193960c.tar.gz
egit-0ee4c7f4c9cb3e20adc204bfc1063e089193960c.tar.bz2
Remove execution listener in finally block refs/changes/05/3005/2
... 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.java7
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 ff6a9a5..9557e60 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);
}
}
});