Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2010-08-09 19:56:11 +0000
committerDarin Wright2010-08-09 19:56:11 +0000
commita27fb849b4a0ac98d8bab357a403a2ceafc96400 (patch)
tree87cc5a1abccb8071c7de78827a8d75fd743de514 /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup
parentb4328c87c39bbe77898355c3bfb04e3b12cdd0f1 (diff)
downloadeclipse.platform.debug-a27fb849b4a0ac98d8bab357a403a2ceafc96400.tar.gz
eclipse.platform.debug-a27fb849b4a0ac98d8bab357a403a2ceafc96400.tar.xz
eclipse.platform.debug-a27fb849b4a0ac98d8bab357a403a2ceafc96400.zip
Bug 321658 - Debug leaks WorkbenchWindow
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java5
2 files changed, 11 insertions, 4 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
index 50dc8a3d9..5a5a594de 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -73,6 +73,7 @@ public class SourceLookupManager implements IWindowListener {
public void windowClosed(IWorkbenchWindow window) {
SourceLookupService service = (SourceLookupService) fServices.get(window);
if (service != null) {
+ fServices.remove(window);
service.dispose();
}
}
@@ -81,8 +82,11 @@ public class SourceLookupManager implements IWindowListener {
* @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
*/
public void windowOpened(IWorkbenchWindow window) {
- SourceLookupService service = new SourceLookupService(window);
- fServices.put(window, service);
+ SourceLookupService service = (SourceLookupService) fServices.get(window);
+ if (service == null) {
+ service = new SourceLookupService(window);
+ fServices.put(window, service);
+ }
}
/* (non-Javadoc)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
index b2d28c017..b4c92f3d5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -43,6 +43,7 @@ public class SourceLookupService implements IDebugContextListener, ISourceDispla
public void dispose() {
fDebugContextService.removeDebugContextListener(this);
+ fWindow = null;
}
public synchronized void debugContextChanged(DebugContextEvent event) {
@@ -60,6 +61,8 @@ public class SourceLookupService implements IDebugContextListener, ISourceDispla
* @param force
*/
protected synchronized void displaySource(ISelection selection, IWorkbenchPart part, boolean force) {
+ if (fWindow == null) return; // disposed
+
if (selection instanceof IStructuredSelection) {
IStructuredSelection structuredSelection = (IStructuredSelection)selection;
if (structuredSelection.size() == 1) {

Back to the top