diff options
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 2ef319e695a0..c0a016da142b 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -165,6 +165,7 @@ struct XmlFilterBaseImpl TextFieldStack maTextFieldStack; explicit XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ); + ~XmlFilterBaseImpl(); }; @@ -177,6 +178,10 @@ XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxCo registerNamespaces(maFastParser); } +XmlFilterBaseImpl::~XmlFilterBaseImpl() +{ +} + XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : FilterBase( rxContext ), mxImpl( new XmlFilterBaseImpl( rxContext ) ), @@ -187,6 +192,14 @@ XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) XmlFilterBase::~XmlFilterBase() { + // #i118640# Reset the DocumentHandler at the FastSaxParser manually; this is + // needed since the mechanism is that instances of FragmentHandler execute + // their stuff (creating objects, setting attributes, ...) on being destroyed. + // They get destroyed by setting a new DocumentHandler. This also happens in + // the following implicit destruction chain of ~XmlFilterBaseImpl, but in that + // case it's member RelationsMap maRelationsMap will be destroyed, but maybe + // still be used by ~FragmentHandler -> crash. + mxImpl->maFastParser.setDocumentHandler( 0 ); } // ---------------------------------------------------------------------------- |