mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 21:35:40 +02:00
Preventive fix for 207317: Project Explorer freezes when selecting any Working Set
This commit is contained in:
parent
fc77ba4a0a
commit
d3fd594242
1 changed files with 9 additions and 2 deletions
|
@ -86,8 +86,12 @@ public class CElementWorkingSetUpdater implements IWorkingSetUpdater, IElementCh
|
||||||
return fElements.indexOf(element);
|
return fElements.indexOf(element);
|
||||||
}
|
}
|
||||||
public void set(int index, Object element) {
|
public void set(int index, Object element) {
|
||||||
fElements.set(index, element);
|
if (element == null) {
|
||||||
fChanged= true;
|
remove(index);
|
||||||
|
} else {
|
||||||
|
fElements.set(index, element);
|
||||||
|
fChanged= true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public void remove(int index) {
|
public void remove(int index) {
|
||||||
if (fElements.remove(index) != null) {
|
if (fElements.remove(index) != null) {
|
||||||
|
@ -283,6 +287,9 @@ public class CElementWorkingSetUpdater implements IWorkingSetUpdater, IElementCh
|
||||||
IProject project= resource.getProject();
|
IProject project= resource.getProject();
|
||||||
remove= (project != null ? project.isOpen() : true) && !resource.exists();
|
remove= (project != null ? project.isOpen() : true) && !resource.exists();
|
||||||
}
|
}
|
||||||
|
} else if (element == null) {
|
||||||
|
// should not happen anyway, but who knows?
|
||||||
|
remove= true;
|
||||||
}
|
}
|
||||||
if (remove) {
|
if (remove) {
|
||||||
iter.remove();
|
iter.remove();
|
||||||
|
|
Loading…
Add table
Reference in a new issue