From 1a33947a91685808fd5f6d4903b6ae896686066d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 4 Jul 2018 10:07:46 +0200 Subject: pass SwField around by std::unique_ptr Fix leak in SwFieldPage::InsertField, where it interacts badly with SwFieldMgr::UpdateCurField The awkward return std::unique_ptr(pTmp.release()); code is because clang 3.8.0 doesn't seem able to do auto-upcast of std::unique_ptr. Change-Id: I05b748e9cda145fd972a01bfa343239df32368b9 Reviewed-on: https://gerrit.libreoffice.org/57197 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/inc/SwUndoField.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sw/inc/SwUndoField.hxx') diff --git a/sw/inc/SwUndoField.hxx b/sw/inc/SwUndoField.hxx index e9ef5d8dcb38..f27aed1a830c 100644 --- a/sw/inc/SwUndoField.hxx +++ b/sw/inc/SwUndoField.hxx @@ -43,7 +43,7 @@ public: class SwUndoFieldFromDoc : public SwUndoField { - SwField * pOldField, * pNewField; + std::unique_ptr pOldField, pNewField; SwMsgPoolItem * pHint; bool bUpdate; -- cgit