diff options
author | Mark Page <aptitude@btconnect.com> | 2016-06-07 09:09:07 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-08 10:59:32 +0000 |
commit | 5164ac456f3cb51949fe3bec293660fab74d26de (patch) | |
tree | 8f30c614d496113f3d515d2301179680291699fc | |
parent | aed4c42491b294cb57efc950a4d0209116be6452 (diff) |
tdf#96099 Remove SfxInterfaceArr_Impl typedef
Added comment in SfxModule with warning about using smart pointers
Change-Id: I1997d41a0a77c7e82e486bcdaee0ea876fdc61ad
Reviewed-on: https://gerrit.libreoffice.org/25999
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | include/sfx2/module.hxx | 3 | ||||
-rw-r--r-- | include/sfx2/msgpool.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/appl/module.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/control/msgpool.cxx | 4 |
4 files changed, 8 insertions, 6 deletions
diff --git a/include/sfx2/module.hxx b/include/sfx2/module.hxx index 787167503fd3..72f25f5af782 100644 --- a/include/sfx2/module.hxx +++ b/include/sfx2/module.hxx @@ -53,6 +53,9 @@ class SFX2_DLLPUBLIC SfxModule : public SfxShell { private: ResMgr* pResMgr; + + // Warning this cannot be turned into a unique_ptr. + // SfxInterface destruction in the SfxSlotPool refers again to pImpl after deletion of pImpl has commenced. See tdf#100270 SfxModule_Impl* pImpl; SAL_DLLPRIVATE void Construct_Impl(); diff --git a/include/sfx2/msgpool.hxx b/include/sfx2/msgpool.hxx index b4ff13275ae3..d38a73c3007d 100644 --- a/include/sfx2/msgpool.hxx +++ b/include/sfx2/msgpool.hxx @@ -31,13 +31,12 @@ class SfxInterface; class SfxSlot; typedef std::basic_string< sal_uInt16 > SfxSlotGroupArr_Impl; -typedef std::vector<SfxInterface*> SfxInterfaceArr_Impl; class SFX2_DLLPUBLIC SfxSlotPool { std::unique_ptr<SfxSlotGroupArr_Impl> _pGroups; SfxSlotPool* _pParentPool; - std::unique_ptr<SfxInterfaceArr_Impl> _pInterfaces; + std::unique_ptr< std::vector<SfxInterface*> > _pInterfaces; sal_uInt16 _nCurGroup; sal_uInt16 _nCurInterface; sal_uInt16 _nCurMsg; diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index bb1730dedcde..397872375122 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -92,7 +92,8 @@ ImageList* SfxModule_Impl::GetImageList( ResMgr* pResMgr, bool bBig ) rpList = new ImageList(); } - return rpList; } + return rpList; +} SFX_IMPL_SUPERCLASS_INTERFACE(SfxModule, SfxShell) @@ -147,7 +148,6 @@ SfxModule::~SfxModule() break; } } - } delete pImpl; diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx index eb38323424f6..ab832d6464c7 100644 --- a/sfx2/source/control/msgpool.cxx +++ b/sfx2/source/control/msgpool.cxx @@ -55,7 +55,7 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface ) { // add to the list of SfxObjectInterface instances if(!_pInterfaces) - _pInterfaces.reset(new SfxInterfaceArr_Impl); + _pInterfaces.reset(new std::vector<SfxInterface*> ); _pInterfaces->push_back(&rInterface); // Stop at a (single) Null-slot (for syntactic reasons the interfaces @@ -106,7 +106,7 @@ void SfxSlotPool::ReleaseInterface( SfxInterface& rInterface ) return ; // remove from the list of SfxInterface instances - SfxInterfaceArr_Impl::iterator i = std::find(_pInterfaces->begin(), _pInterfaces->end(), &rInterface); + auto i = std::find(_pInterfaces->begin(), _pInterfaces->end(), &rInterface); if(i != _pInterfaces->end()) _pInterfaces->erase(i); } |