diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-02-17 19:49:27 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 22:22:10 +0100 |
commit | ef5ee3247467a2bae5ae12f758a75758f58afaa4 (patch) | |
tree | 63b9f622da893cdf732e1f1d021b44a973bfdb6c /svx | |
parent | 8b9b9985b04b8f3b602890806ea905f8c7cb45ba (diff) |
vcl: more double-dispose protection, and survival after dispose.
Change-Id: I271f9bcb85d07a28abef2d97ef3c31287878324d
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 55746fc59607..b2926fd970f9 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -338,7 +338,10 @@ SvxStyleBox_Impl::~SvxStyleBox_Impl() void SvxStyleBox_Impl::dispose() { for(int i = 0; i < MAX_STYLES_ENTRIES; i++) + { delete m_pButtons[i]; + m_pButtons[i] = NULL; + } ComboBox::dispose(); } @@ -2297,21 +2300,19 @@ void SvxStyleToolBoxControl::SetFamilyState( sal_uInt16 nIdx, IMPL_LINK_NOARG(SvxStyleToolBoxControl, VisibilityNotification) { - - sal_uInt16 i; - // Call ReBind() && UnBind() according to visibility SvxStyleBox_Impl* pBox = static_cast<SvxStyleBox_Impl*>( GetToolBox().GetItemWindow( GetId() )); - if ( pBox->IsVisible() && !isBound() ) + + if ( pBox && pBox->IsVisible() && !isBound() ) { - for ( i=0; i<MAX_FAMILIES; i++ ) + for ( sal_uInt16 i=0; i<MAX_FAMILIES; i++ ) pBoundItems [i]->ReBind(); bindListener(); } - else if ( !pBox->IsVisible() && isBound() ) + else if ( (!pBox || !pBox->IsVisible()) && isBound() ) { - for ( i=0; i<MAX_FAMILIES; i++ ) + for ( sal_uInt16 i=0; i<MAX_FAMILIES; i++ ) pBoundItems[i]->UnBind(); unbindListener(); } |