[Libreoffice-commits] core.git: sfx2/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Jan 23 06:44:46 UTC 2018


 sfx2/source/control/itemdel.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6ada5c93080b4a377ba4f7bb4f8677949cfa2e94
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Jan 16 15:22:36 2018 +0200

    loplugin:useuniqueptr in SfxItemDisruptor_Impl
    
    Change-Id: Ie85c1a8fd699f68ffcc8853be4bf8a86cfec06e7
    Reviewed-on: https://gerrit.libreoffice.org/48295
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sfx2/source/control/itemdel.cxx b/sfx2/source/control/itemdel.cxx
index 9ee76fd6a2bb..c6d53ef45936 100644
--- a/sfx2/source/control/itemdel.cxx
+++ b/sfx2/source/control/itemdel.cxx
@@ -26,7 +26,7 @@
 
 class SfxItemDisruptor_Impl
 {
-    SfxPoolItem *           pItem;
+    std::unique_ptr<SfxPoolItem> pItem;
     Idle m_Idle;
 
 private:
@@ -64,7 +64,7 @@ SfxItemDisruptor_Impl::~SfxItemDisruptor_Impl()
     // reset RefCount (was set to SFX_ITEMS_SPECIAL before!)
     pItem->SetRefCount( 0 );
 
-    delete pItem;
+    pItem.reset();
 }
 
 IMPL_LINK_NOARG(SfxItemDisruptor_Impl, Delete, Timer*, void)


More information about the Libreoffice-commits mailing list