From f5e2dbb40cab1a21dc972806ee4038f52843e838 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 26 Jun 2018 12:17:27 +0200 Subject: Avoid potential double-delete in ~XMLFile2UTFConverter ...as the implicitly defined copy operations would just copy the m_p* member pointers. Needed some modification of the ParserCleanup class so that Entity (which has a XMLFile2UTFConverter member) can be std::move'd into SaxExpatParser_Impl::pushEntity. Found by new -Wdeprecated-copy of GCC trunk towards GCC 9. Change-Id: I0cb5b5dbcd55249b475ed74b4ac6bcb12f20f2c6 Reviewed-on: https://gerrit.libreoffice.org/56453 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- sax/inc/xml2utf.hxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sax/inc') diff --git a/sax/inc/xml2utf.hxx b/sax/inc/xml2utf.hxx index 0a26c1f81482..3e6d09cda3a0 100644 --- a/sax/inc/xml2utf.hxx +++ b/sax/inc/xml2utf.hxx @@ -20,6 +20,10 @@ #ifndef INCLUDED_SAX_INC_XML2UTF_HXX #define INCLUDED_SAX_INC_XML2UTF_HXX +#include + +#include + #include namespace sax_expatwrap { @@ -73,13 +77,9 @@ class XMLFile2UTFConverter { public: XMLFile2UTFConverter( ): - m_bStarted( false ), - m_pText2Unicode( nullptr ), - m_pUnicode2Text( nullptr ) + m_bStarted( false ) {} - ~XMLFile2UTFConverter(); - void setInputStream( css::uno::Reference< css::io::XInputStream > const &r ) { m_in = r; } void setEncoding( const OString &s ) { m_sEncoding = s; } @@ -116,8 +116,8 @@ private: bool m_bStarted; OString m_sEncoding; - Text2UnicodeConverter *m_pText2Unicode; - Unicode2TextConverter *m_pUnicode2Text; + std::unique_ptr m_pText2Unicode; + std::unique_ptr m_pUnicode2Text; }; } -- cgit