From 25d400816fd288324c0a9b53bb132e7a9bd1770f Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Wed, 29 Oct 2003 16:39:34 +0000 Subject: [PATCH] When doing ther reset of the binary parser, recreate the project. --- .../cdt/internal/core/model/CModelManager.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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 13e067a8e6a..93711a9556d 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 @@ -46,12 +46,12 @@ import org.eclipse.core.runtime.IProgressMonitor; public class CModelManager implements IResourceChangeListener { - /** - * Unique handle onto the CModel - */ - final CModel cModel = new CModel(); + /** + * Unique handle onto the CModel + */ + final CModel cModel = new CModel(); - public static HashSet OptionNames = new HashSet(20); + public static HashSet OptionNames = new HashSet(20); /** * Used to convert IResourceDeltas into ICElementDeltas. @@ -356,7 +356,11 @@ public class CModelManager implements IResourceChangeListener { if (project != null) { ICElement celement = create(project); if (celement != null) { + // Let the function remove the children + // but it has the side of effect of removing the CProject also + // so we have to recall create again. releaseCElement(celement); + celement = create(project); // Fired and ICElementDelta.PARSER_CHANGED CElementDelta delta = new CElementDelta(getCModel()); delta.binaryParserChanged(celement); @@ -554,8 +558,8 @@ public class CModelManager implements IResourceChangeListener { case IResourceChangeEvent.PRE_DELETE : try{ if (resource.getType() == IResource.PROJECT && - ( ((IProject)resource).hasNature(CProjectNature.C_NATURE_ID) || - ((IProject)resource).hasNature(CCProjectNature.CC_NATURE_ID) )){ + ( ((IProject)resource).hasNature(CProjectNature.C_NATURE_ID) || + ((IProject)resource).hasNature(CCProjectNature.CC_NATURE_ID) )){ this.deleting((IProject) resource);} }catch (CoreException e){ }