clean up parser data

pull/1/head
Michael Peter Christen 13 years ago
parent 276a66a793
commit ad09b786bf

@ -821,6 +821,17 @@ dc_rights
ContentScraper.addAllImages(images, doc.getImages());
if (doc.lon() != 0.0f && doc.lat() != 0.0f) { lon = doc.lon(); lat = doc.lat(); }
}
// clean up parser data
for (final Document doc: docs) {
Object parserObject = doc.getParserObject();
if (parserObject instanceof ContentScraper) {
final ContentScraper html = (ContentScraper) parserObject;
html.close();
}
}
// return consolidation
return new Document(
location,
globalMime,

@ -864,9 +864,18 @@ public class ContentScraper extends AbstractScraper implements Scraper {
// free resources
super.close();
this.anchors.clear();
this.rss.clear();
this.css.clear();
this.script.clear();
this.frames.clear();
this.iframes.clear();
this.embeds.clear();
this.images.clear();
this.metas.clear();
this.title = null;
this.headlines = null;
this.bold.clear();
this.italic.clear();
this.content.clear();
this.root = null;
}

@ -143,7 +143,6 @@ public class htmlParser extends AbstractParser implements Parser {
scraper.getRSS(),
scraper.getImages(),
scraper.indexingDenied());
//scraper.close();
ppd.setFavicon(scraper.getFavicon());
return ppd;

Loading…
Cancel
Save