diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-04-23 22:52:39 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-04-24 12:22:01 +0200 |
commit | 135e4d5c730b8b252eab3e375580a3a73d8204e6 (patch) | |
tree | 963acb55d8d7157e3ee98e9a65e823017591902e /sw/source/core/layout/atrfrm.cxx | |
parent | 4e353190b68f3a89c43b3861444dd2dd6b02a6e0 (diff) |
related: tdf#90820 refactor SwFrm destruction
Move all logic out of destructors, so it cannot happen any more that
members of a sub-class are accessed from a superclass destructor, when
those members are already dead.
Logic is now in virtual DestroyImpl() methods.
All SwFrms must be deleted with SwFrm::DestroySwFrm().
Change-Id: Icec5b12e12d5a2d955cb5844d7d4f7ac85ab79cd
Diffstat (limited to 'sw/source/core/layout/atrfrm.cxx')
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index dda591bf212e..f92ec8bbfeb2 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2645,7 +2645,7 @@ void SwFrmFmt::DelFrms() if( pLast ) do { pLast->Cut(); - delete pLast; + SwFrm::DestroyFrm(pLast); } while( 0 != ( pLast = aIter.Next() )); } @@ -2852,8 +2852,9 @@ SwFlyFrmFmt::~SwFlyFrmFmt() SwIterator<SwFlyFrm,SwFmt> aIter( *this ); SwFlyFrm * pLast = aIter.First(); if( pLast ) - do { - delete pLast; + do + { + SwFrm::DestroyFrm(pLast); } while( 0 != ( pLast = aIter.Next() )); SwIterator<SwFlyDrawContact,SwFmt> a2ndIter( *this ); @@ -3269,7 +3270,7 @@ SwHandleAnchorNodeChg::SwHandleAnchorNodeChg( SwFlyFrmFmt& _rFlyFrmFmt, if ( pFrm != _pKeepThisFlyFrm ) { pFrm->Cut(); - delete pFrm; + SwFrm::DestroyFrm(pFrm); } } while( 0 != ( pFrm = aIter.Next() )); } |