Skip to content

Commit

Permalink
Improve checkin d4e04fc
Browse files Browse the repository at this point in the history
Removal of unused list of modelObjects
Use of root.iter prevented clearing __dict__ of objects,
resulting in slow close of some instances.
  • Loading branch information
Herm Fischer committed Jan 28, 2015
1 parent f5ed746 commit 1d5c91d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arelle/ModelDocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,8 @@ def close(self, visited=None, urlDocs=None):
xmlDocument = self.xmlDocument
dummyRootElement = self.parser.makeelement("{http://dummy}dummy") # may fail for streaming
for modelObject in self.xmlRootElement.iter():
modelObject.clear() # clear children
modelObject.__dict__.clear() # clear python variables of modelObjects (not lxml)
self.xmlRootElement.clear() # clear entire lxml subtree
self.parserLookupName.__dict__.clear()
self.parserLookupClass.__dict__.clear()
self.__dict__.clear() # dereference everything before clearing xml tree
Expand Down

0 comments on commit 1d5c91d

Please sign in to comment.