summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2014-02-24 20:25:26 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-25 12:26:10 +0000
commitb88cb7b4f23dcd02177e6e3578e3b3ba14454c1c (patch)
tree13648ca5cbac777fa73099104c7dbb876057c9d5
parentd86ecb8512d19d8dcf073ceb1fd9813554397bd4 (diff)
Resolves: #i118640# force early destruction of last FragmentHandler...
to not let it use an already destroyed RelationsMap instance (cherry picked from commit 190444f7fd3fa9cfcd1955b3f5dcd916184d02f4) Conflicts: oox/source/core/xmlfilterbase.cxx Change-Id: Ibd09ff9fcba8f919df0704c8e3a64423518b932f (cherry picked from commit b071ce32befcc84a57a7ecd39667cb6658c0c866)
-rw-r--r--oox/source/core/xmlfilterbase.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index fe2055e6eda2..fe222d9d723f 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -104,6 +104,7 @@ struct XmlFilterBaseImpl
TextFieldStack maTextFieldStack;
explicit XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException );
+ ~XmlFilterBaseImpl();
};
// ----------------------------------------------------------------------------
@@ -188,6 +189,10 @@ XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxCo
maFastParser.registerNamespace( ids[i].Second );
}
+XmlFilterBaseImpl::~XmlFilterBaseImpl()
+{
+}
+
XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) :
FilterBase( rxContext ),
mxImpl( new XmlFilterBaseImpl( rxContext ) ),
@@ -198,6 +203,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 );
}
// ----------------------------------------------------------------------------