diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2019-10-18 23:56:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-21 13:27:56 +0200 |
commit | 53e0240109b22db485b4b1212cf63cc8fa4de2be (patch) | |
tree | 917d218a04d9df238f894924017a128a1b93c388 | |
parent | aarch64 callVirtualFunction needs to be compiled w/o -fstack-clash-protection (diff) | |
download | core-53e0240109b22db485b4b1212cf63cc8fa4de2be.tar.gz core-53e0240109b22db485b4b1212cf63cc8fa4de2be.zip |
tdf#128232: fix crash when trying to delete unused User Field
mpFieldTypes is std::unique_ptr<SwFieldTypes>
(see https://opengrok.libreoffice.org/xref/core/sw/source/core/inc/DocumentFieldsManager.hxx?r=99a97d38#104)
See bt:
https://bugs.documentfoundation.org/attachment.cgi?id=155132
Change-Id: Iea8eddd4b1bdc9ce3c01988fc97004b7ec7a6e5f
(cherry picked from commit 09a3762fe0fc4c4815c842098094082bf1b90de6)
Reviewed-on: https://gerrit.libreoffice.org/81120
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 9b1f906ea2aa946e9d6245baacd4937233bb58c6)
Reviewed-on: https://gerrit.libreoffice.org/81220
Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/core/doc/DocumentFieldsManager.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index c66b4ddd22a1..f54eadaf4c7d 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -374,11 +374,10 @@ void DocumentFieldsManager::RemoveFieldType(size_t nField) if( nWhich != SwFieldIds::Database ) { OSL_ENSURE( !pTmp->HasWriterListeners(), "Dependent fields present!" ); - // delete field type - delete pTmp; } else (*mpFieldTypes)[nField].release(); // DB fields are ref-counted and delete themselves + mpFieldTypes->erase( mpFieldTypes->begin() + nField ); m_rDoc.getIDocumentState().SetModified(); } |