diff options
author | Pawel Piech | 2009-01-23 21:58:57 +0000 |
---|---|---|
committer | Pawel Piech | 2009-01-23 21:58:57 +0000 |
commit | 82dbef1ccc38258d06d7b0318b8c5a3f228a9ff0 (patch) | |
tree | 0696bb68943c4a0db755595c4fd5d5ea2329fad6 /dsf | |
parent | b323a0e9b8bf7d6b3085804debba3d447f9f371e (diff) | |
download | org.eclipse.cdt-82dbef1ccc38258d06d7b0318b8c5a3f228a9ff0.tar.gz org.eclipse.cdt-82dbef1ccc38258d06d7b0318b8c5a3f228a9ff0.tar.xz org.eclipse.cdt-82dbef1ccc38258d06d7b0318b8c5a3f228a9ff0.zip |
Bug 262245 - [vm] AbstractVMProvider may install the same model proxy for multiple views, resulting in the viewer not working.
Diffstat (limited to 'dsf')
2 files changed, 12 insertions, 4 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java index de4388e247e..d0a8b339867 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java @@ -637,12 +637,14 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene public IModelProxy createModelProxy(Object element, IPresentationContext context) { // Iterate through the current active proxies to try to find a proxy with the same - // element and re-use it if found. At the same time purge proxies that are no longer + // element and re-use it if found. Only disposed proxies can be re-used because + // multiple viewers cannot use the same proxy. Also at this time purge other proxies + // that are no longer installed. IVMModelProxy proxy = null; for (Iterator<IVMModelProxy> itr = getActiveModelProxies().iterator(); itr.hasNext();) { IVMModelProxy next = itr.next(); if (next != null) { - if (next.getRootElement().equals(element)) { + if (next.getRootElement().equals(element) && next.isDisposed()) { proxy = next; } else if (next.isDisposed()) { itr.remove(); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java index 632a1dc2607..2df17ebf83d 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java @@ -819,11 +819,17 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa @Override public IModelProxy createModelProxy(Object element, IPresentationContext context) { // Iterate through the current active proxies to try to find a proxy with the same - // element and re-use it if found. At the same time purge proxies that are no longer + // element and re-use it if found. Only disposed proxies can be re-used because + // multiple viewers cannot use the same proxy. + // + // Unlike in the base class, do not remove proxies just because they were disposed + // by the viewer. These proxies can contain modification history for variables in + // their cache. The proxies will be removed once their cache entries are emptied. + // See rootElementRemovedFromCache(). IVMModelProxy proxy = null; for (Iterator<IVMModelProxy> itr = getActiveModelProxies().iterator(); itr.hasNext();) { IVMModelProxy next = itr.next(); - if (next != null && next.getRootElement().equals(element)) { + if (next != null && next.getRootElement().equals(element) && next.isDisposed()) { proxy = next; break; } |