Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2008-05-06 16:29:02 -0400
committerPawel Piech2008-05-06 16:29:02 -0400
commitf419145c2373524a7d10db60945b43101cc1a68c (patch)
tree63722b0386cbf2e8dce71b2c27704a1bc943d717 /org.eclipse.debug.ui
parentb4a6858915bcbde1313da871ee9ddd375d1ea780 (diff)
downloadeclipse.platform.debug-f419145c2373524a7d10db60945b43101cc1a68c.tar.gz
eclipse.platform.debug-f419145c2373524a7d10db60945b43101cc1a68c.tar.xz
eclipse.platform.debug-f419145c2373524a7d10db60945b43101cc1a68c.zip
Bug 227477 - IModelProxy.init() and installed() are called inside a synchronized() block in ModelContentProvider
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java26
1 files changed, 19 insertions, 7 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java
index 7c26f3f91..0491a7e6e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java
@@ -780,20 +780,32 @@ abstract class ModelContentProvider implements IContentProvider, IModelChangedLi
Job job = new Job("Model Proxy installed notification job") {//$NON-NLS-1$
protected IStatus run(IProgressMonitor monitor) {
if (!monitor.isCanceled()) {
+ IPresentationContext context = null;
+ Viewer viewer = null;
synchronized (ModelContentProvider.this) {
if (!isDisposed()) {
- proxy.init(getPresentationContext());
- Object[] mcls = fModelListeners.getListeners();
- for (int i = 0; i < mcls.length; i++) {
- proxy.addModelChangedListener((IModelChangedListener) mcls[i]);
- }
- proxy.addModelChangedListener(ModelContentProvider.this);
- proxy.installed(getViewer());
+ context = getPresentationContext();
+ viewer = getViewer();
}
}
+ if (context != null && !proxy.isDisposed()) {
+ proxy.init(context);
+ Object[] mcls = fModelListeners.getListeners();
+ for (int i = 0; i < mcls.length; i++) {
+ proxy.addModelChangedListener((IModelChangedListener) mcls[i]);
+ }
+ proxy.addModelChangedListener(ModelContentProvider.this);
+ proxy.installed(viewer);
+ }
}
return Status.OK_STATUS;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#shouldRun()
+ */
+ public boolean shouldRun() {
+ return !isDisposed();
+ }
};
job.setSystem(true);
job.schedule();

Back to the top