1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 09:15:38 +02:00

Bug 320426: Index grows when updating files.

This commit is contained in:
Markus Schorn 2010-07-21 16:15:16 +00:00
parent faf5bdce21
commit 1becc70584
3 changed files with 11 additions and 2 deletions

View file

@ -535,6 +535,8 @@ public class PDOMASTAdapter {
}
} else if (binding instanceof ICPPTemplateParameter) {
return binding;
} else if (binding instanceof ICPPConstructor) {
return binding;
}
return null;
}

View file

@ -255,7 +255,8 @@ public class PDOMFile implements IIndexFragmentFile {
public void setInternalLocation(String internalLocation) throws CoreException {
Database db = fLinkage.getDB();
long oldRecord = db.getRecPtr(record + LOCATION_REPRESENTATION);
db.free(oldRecord);
if (oldRecord != 0)
db.getString(oldRecord).delete();
db.putRecPtr(record + LOCATION_REPRESENTATION, db.newString(internalLocation).getRecord());
location= null;
}
@ -524,7 +525,12 @@ public class PDOMFile implements IIndexFragmentFile {
* @throws CoreException
*/
public void delete() throws CoreException {
fLinkage.getDB().free(record);
Database db = fLinkage.getDB();
long locRecord = db.getRecPtr(record + LOCATION_REPRESENTATION);
if (locRecord != 0)
db.getString(locRecord).delete();
db.free(record);
}
public void addIncludesTo(IncludeInformation[] includeInfos) throws CoreException {

View file

@ -147,6 +147,7 @@ public class PDOMMacro implements IIndexMacro, IPDOMBinding, IASTFileLocation {
if (params != null) {
params.delete();
}
linkage.getDB().free(fRecord);
}
public PDOMMacroContainer getContainer() throws CoreException {