From Brede Johansen, "Here's a fix to the changes regarding the new dispose() function. The

last primary node inside a push-pop level would not get the dispose()
call.  This would result in information from some ancillary records,
like the matrix (transform), being lost.

Changes are made to the latest version in the repository.

Thanks to Terry for the help to find and fix the bug and test the changes."
This commit is contained in:
Robert Osfield
2008-02-18 13:52:26 +00:00
parent 046481ee6e
commit 91e35599dc

View File

@@ -63,11 +63,19 @@ class PopLevel : public Record
virtual void read(RecordInputStream& /*in*/, Document& document)
{
// Finally call dispose() for primary with push, pop level pair.
PrimaryRecord* primary = document.getTopOfLevelStack();
if (primary)
PrimaryRecord* parentPrimary = document.getTopOfLevelStack();
PrimaryRecord* currentPrimary = document.getCurrentPrimaryRecord();
// Call dispose() for primary without push, pop level pair.
if (currentPrimary && currentPrimary!=parentPrimary)
{
primary->dispose(document);
currentPrimary->dispose(document);
}
// Call dispose() for primary with push, pop level pair.
if (parentPrimary)
{
parentPrimary->dispose(document);
}
document.popLevel();