diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-02-13 12:40:17 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-13 14:56:17 +0000 |
commit | abc6d50af7baa101f87489038b2053e032def821 (patch) | |
tree | 03f3706b66c90b134cf63eec09c351396ad34a98 | |
parent | d29f6eb1dc0524972d6b6cefe33251b915465e77 (diff) |
coverity#736486 try and make coverity see through this better
Change-Id: I6becf305d88618fb53dff3519b31b010e371ab44
-rw-r--r-- | svtools/source/misc/itemdel.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/svtools/source/misc/itemdel.cxx b/svtools/source/misc/itemdel.cxx index ad5624083c3e..9a20be97284c 100644 --- a/svtools/source/misc/itemdel.cxx +++ b/svtools/source/misc/itemdel.cxx @@ -38,12 +38,13 @@ class SfxItemDesruptor_Impl Link aLink; private: - DECL_LINK( Delete, void * ); - SfxItemDesruptor_Impl( const SfxItemDesruptor_Impl& ); // n.i. + DECL_LINK( Delete, void* ); + SfxItemDesruptor_Impl( const SfxItemDesruptor_Impl& ); // n.i. public: - SfxItemDesruptor_Impl( SfxPoolItem *pItemToDesrupt ); - ~SfxItemDesruptor_Impl(); + SfxItemDesruptor_Impl( SfxPoolItem *pItemToDesrupt ); + void LaunchDeleteOnIdle(); + ~SfxItemDesruptor_Impl(); }; // ------------------------------------------------------------------------ @@ -55,7 +56,10 @@ SfxItemDesruptor_Impl::SfxItemDesruptor_Impl( SfxPoolItem *pItemToDesrupt ): DBG_ASSERT( 0 == pItem->GetRefCount(), "disrupting pooled item" ); pItem->SetKind( SFX_ITEMS_DELETEONIDLE ); +} +void SfxItemDesruptor_Impl::LaunchDeleteOnIdle() +{ // process in Idle GetpApp()->InsertIdleHdl( aLink, 1 ); } @@ -82,11 +86,11 @@ IMPL_LINK_NOARG(SfxItemDesruptor_Impl, Delete) return 0; } -// ------------------------------------------------------------------------ -void DeleteItemOnIdle( SfxPoolItem* pItem ) +void DeleteItemOnIdle(SfxPoolItem* pItem) { DBG_ASSERT( 0 == pItem->GetRefCount(), "deleting item in use" ); - new SfxItemDesruptor_Impl( pItem ); + SfxItemDesruptor_Impl *pDesruptor = new SfxItemDesruptor_Impl(pItem); + pDesruptor->LaunchDeleteOnIdle(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |