diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-08-12 16:41:30 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-08-12 16:41:55 +0200 |
commit | a8df509ca4e4e77e9ed684d627ee08d84805f534 (patch) | |
tree | 13d212cd32351909a6ba4fac18e152d684a75c20 | |
parent | f91d4f156b4fdb6e6a8a755714fd384bfa275e3d (diff) |
error: dereferencing type-punned pointer will break strict-aliasing rules
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
Change-Id: Id8f1828ae1dabc2f928d737d4fac8375dd73b5a2
-rw-r--r-- | sfx2/source/appl/appquit.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/inc/sfxtypes.hxx | 5 |
4 files changed, 16 insertions, 15 deletions
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx index 7a5daab00d88..b94436a0a488 100644 --- a/sfx2/source/appl/appquit.cxx +++ b/sfx2/source/appl/appquit.cxx @@ -131,15 +131,15 @@ void SfxApplication::Deinitialize() // from here no SvObjects have to exists DELETEZ(pAppData_Impl->pMatcher); - DELETEX(pAppData_Impl->pSlotPool); - DELETEX(pAppData_Impl->pFactArr); - - DELETEX(pAppData_Impl->pTbxCtrlFac); - DELETEX(pAppData_Impl->pStbCtrlFac); - DELETEX(pAppData_Impl->pMenuCtrlFac); - DELETEX(pAppData_Impl->pViewFrames); - DELETEX(pAppData_Impl->pViewShells); - DELETEX(pAppData_Impl->pObjShells); + DELETEX(SfxSlotPool, pAppData_Impl->pSlotPool); + DELETEX(SfxChildWinFactArr_Impl, pAppData_Impl->pFactArr); + + DELETEX(SfxTbxCtrlFactArr_Impl, pAppData_Impl->pTbxCtrlFac); + DELETEX(SfxStbCtrlFactArr_Impl, pAppData_Impl->pStbCtrlFac); + DELETEX(SfxMenuCtrlFactArr_Impl, pAppData_Impl->pMenuCtrlFac); + DELETEX(SfxViewFrameArr_Impl, pAppData_Impl->pViewFrames); + DELETEX(SfxViewShellArr_Impl, pAppData_Impl->pViewShells); + DELETEX(SfxObjectShellArr_Impl, pAppData_Impl->pObjShells); //TODO/CLEANTUP //ReleaseArgs could be used instead! diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 203f2006b74a..1dee9ace33f1 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -1013,10 +1013,10 @@ void SfxCommonTemplateDialog_Impl::ClearResource() void SfxCommonTemplateDialog_Impl::impl_clear() { - DELETEX(pStyleFamilies); + DELETEX(SfxStyleFamilies, pStyleFamilies); sal_uInt16 i; for ( i = 0; i < MAX_FAMILIES; ++i ) - DELETEX(pFamilyState[i]); + DELETEX(SfxTemplateItem, pFamilyState[i]); for ( i = 0; i < COUNT_BOUND_FUNC; ++i ) delete pBoundItems[i]; pCurObjShell = NULL; diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 2acf6c4e1c96..dcb4f1bf42bd 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -363,7 +363,7 @@ SfxObjectShell::~SfxObjectShell() SfxObjectShell::Close(); pImp->pBaseModel.set( NULL ); - DELETEX(pImp->pReloadTimer ); + DELETEX(AutoReloadTimer_Impl, pImp->pReloadTimer ); SfxApplication *pSfxApp = SFX_APP(); if ( USHRT_MAX != pImp->nVisualDocumentNumber ) @@ -398,7 +398,7 @@ SfxObjectShell::~SfxObjectShell() if ( IsDocShared() ) FreeSharedFile(); #endif - DELETEX( pMedium ); + DELETEX( SfxMedium, pMedium ); } // The removing of the temporary file must be done as the latest step in the document destruction diff --git a/sfx2/source/inc/sfxtypes.hxx b/sfx2/source/inc/sfxtypes.hxx index aa573a002687..e12ed3b67fb3 100644 --- a/sfx2/source/inc/sfxtypes.hxx +++ b/sfx2/source/inc/sfxtypes.hxx @@ -34,9 +34,10 @@ #ifndef DELETEX #ifdef DBG_UTIL -#define DELETEX(pPtr) ( delete pPtr, (void*&) pPtr = (void*) 0xFFFFFFFF ) +#define DELETEX(T, pPtr) \ + ( delete pPtr, pPtr = reinterpret_cast<T *>(sal_IntPtr(-1)) ) #else -#define DELETEX(pPtr) delete pPtr +#define DELETEX(T, pPtr) delete pPtr #endif #endif |