diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog index 1a37636fdad..a57be2160af 100644 --- a/core/org.eclipse.cdt.core/ChangeLog +++ b/core/org.eclipse.cdt.core/ChangeLog @@ -1,3 +1,12 @@ +2003-10-29 David Inglis + + Fix for 45734 & 45736, Though this only addresses a small part on the later. + + Prevents child element creation when releasing parent element + Prevent binary file check when have already obtained a translation unit. + + * model/org/eclipse/cdt/internal/core/CModelManager.java + 2003-10-29 Alain Magloire Fix for PR 45733 diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java index 2f7abd6acd0..b1ae996695d 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java @@ -215,9 +215,8 @@ public class CModelManager implements IResourceChangeListener { ICElement cfile = null; if (isTranslationUnit(file)) { - cfile = new TranslationUnit(parent, file);} - - if (file.exists()) { + cfile = new TranslationUnit(parent, file); + } else if (file.exists()) { // Try to create the binaryFile first. if (bin == null) { bin = createBinaryFile(file); @@ -313,21 +312,23 @@ public class CModelManager implements IResourceChangeListener { } if (celement instanceof IParent) { - CElementInfo info = ((CElement)celement).getElementInfo(); - if (info != null) { - ICElement[] children = info.getChildren(); - for (int i = 0; i < children.length; i++) { - releaseCElement(children[i]); - } - // Make sure we destroy the BinaryContainer and ArchiveContainer - // Since they are not part of the children. - if (info instanceof CProjectInfo) { - CProjectInfo pinfo = (CProjectInfo) info; - if (pinfo.vBin != null) { - releaseCElement(pinfo.vBin); + if ( peekAtInfo(celement) != null ) { + CElementInfo info = ((CElement)celement).getElementInfo(); + if (info != null) { + ICElement[] children = info.getChildren(); + for (int i = 0; i < children.length; i++) { + releaseCElement(children[i]); } - if (pinfo.vLib != null) { - releaseCElement(pinfo.vLib); + // Make sure we destroy the BinaryContainer and ArchiveContainer + // Since they are not part of the children. + if (info instanceof CProjectInfo) { + CProjectInfo pinfo = (CProjectInfo) info; + if (pinfo.vBin != null) { + releaseCElement(pinfo.vBin); + } + if (pinfo.vLib != null) { + releaseCElement(pinfo.vLib); + } } } }