diff options
Diffstat (limited to 'lingucomponent')
-rw-r--r-- | lingucomponent/source/spellcheck/spell/sspellimp.cxx | 9 | ||||
-rw-r--r-- | lingucomponent/source/spellcheck/spell/sspellimp.hxx | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 12b9e240fa24..db6c183a8cef 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -72,7 +72,6 @@ using namespace linguistic; SpellChecker::SpellChecker() : m_aEvtListeners(GetLinguMutex()), - m_pPropHelper(nullptr), m_bDisposing(false) { } @@ -87,7 +86,6 @@ SpellChecker::~SpellChecker() if (m_pPropHelper) { m_pPropHelper->RemoveAsPropListener(); - delete m_pPropHelper; } } @@ -97,7 +95,7 @@ PropertyHelper_Spelling & SpellChecker::GetPropHelper_Impl() { Reference< XLinguProperties > xPropSet( GetLinguProperties(), UNO_QUERY ); - m_pPropHelper = new PropertyHelper_Spelling( static_cast<XSpellChecker *>(this), xPropSet ); + m_pPropHelper.reset( new PropertyHelper_Spelling( static_cast<XSpellChecker *>(this), xPropSet ) ); m_pPropHelper->AddAsPropListener(); //! after a reference is established } return *m_pPropHelper; @@ -577,7 +575,7 @@ void SAL_CALL SpellChecker::initialize( const Sequence< Any >& rArguments ) //! And the reference to the UNO-functions while increasing //! the ref-count and will implicitly free the memory //! when the object is no longer used. - m_pPropHelper = new PropertyHelper_Spelling( static_cast<XSpellChecker *>(this), xPropSet ); + m_pPropHelper.reset( new PropertyHelper_Spelling( static_cast<XSpellChecker *>(this), xPropSet ) ); m_pPropHelper->AddAsPropListener(); //! after a reference is established } else { @@ -598,8 +596,7 @@ void SAL_CALL SpellChecker::dispose() if (m_pPropHelper) { m_pPropHelper->RemoveAsPropListener(); - delete m_pPropHelper; - m_pPropHelper = nullptr; + m_pPropHelper.reset(); } } } diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.hxx b/lingucomponent/source/spellcheck/spell/sspellimp.hxx index d8e5581463da..82ddbedf0af3 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.hxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.hxx @@ -69,7 +69,7 @@ class SpellChecker : Sequence< Locale > m_aSuppLocales; ::comphelper::OInterfaceContainerHelper2 m_aEvtListeners; - linguistic::PropertyHelper_Spelling* m_pPropHelper; + std::unique_ptr<linguistic::PropertyHelper_Spelling> m_pPropHelper; bool m_bDisposing; SpellChecker(const SpellChecker &) = delete; |