[Libreoffice-commits] core.git: Branch 'feature/vclref' - 2 commits - dbaccess/source svtools/source vcl/source
Michael Meeks
michael.meeks at collabora.com
Thu Feb 26 09:58:48 PST 2015
dbaccess/source/ui/app/AppDetailPageHelper.cxx | 4 +
svtools/source/contnr/ivctrl.cxx | 6 +-
svtools/source/contnr/treelistbox.cxx | 52 +++++++++++++++----------
vcl/source/window/split.cxx | 8 ++-
vcl/source/window/syswin.cxx | 2
5 files changed, 47 insertions(+), 25 deletions(-)
New commits:
commit 22231adfee3c364855f900c0f22ff00033503580
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Feb 26 17:10:15 2015 +0000
dbaccess: protection against double disposes.
Change-Id: I4ce2d00248b3d3d8370cc58155ea0607d4de482b
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 8b8bc2c..5461767 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -257,9 +257,11 @@ void OAppDetailPageHelper::dispose()
}
m_aFL.disposeAndClear();
m_aTBPreview.disposeAndClear();
- m_aBorder.disposeAndClear();
m_aPreview.disposeAndClear();
m_aDocumentInfo.disposeAndClear();
+ m_aBorder.disposeAndClear();
+ m_aMenu.reset();
+
vcl::Window::dispose();
}
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 3a9eda0..53a1520 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1564,29 +1564,43 @@ SvTreeListBox::~SvTreeListBox()
void SvTreeListBox::dispose()
{
-
- pImp->CallEventListeners( VCLEVENT_OBJECT_DYING );
- delete pImp;
- delete mpImpl->m_pLink;
- ClearTabList();
-
- delete pEdCtrl;
- pEdCtrl = 0;
- pModel->RemoveView( this );
- if ( pModel->GetRefCount() == 0 )
+ if( pImp )
{
- pModel->Clear();
- delete pModel;
- pModel = NULL;
+ pImp->CallEventListeners( VCLEVENT_OBJECT_DYING );
+ delete pImp;
+ pImp = NULL;
}
+ if( mpImpl )
+ {
+ delete mpImpl->m_pLink;
+ mpImpl->m_pLink = NULL;
+
+ ClearTabList();
+
+ delete pEdCtrl;
+ pEdCtrl = NULL;
+
+ if( pModel )
+ {
+ pModel->RemoveView( this );
+ if ( pModel->GetRefCount() == 0 )
+ {
+ pModel->Clear();
+ delete pModel;
+ pModel = NULL;
+ }
+ }
- SvTreeListBox::RemoveBoxFromDDList_Impl( *this );
+ SvTreeListBox::RemoveBoxFromDDList_Impl( *this );
+
+ if( this == pDDSource )
+ pDDSource = 0;
+ if( this == pDDTarget )
+ pDDTarget = 0;
+ delete mpImpl;
+ mpImpl = NULL;
+ }
- if( this == pDDSource )
- pDDSource = 0;
- if( this == pDDTarget )
- pDDTarget = 0;
- delete mpImpl;
Control::dispose();
}
commit 028a68d4353f75eadec8c1d8260940ebb6fb7ffe
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Feb 26 16:50:17 2015 +0000
vcl: more double dispose protection.
Change-Id: Ib5c4ca5747cd55d7ea0f8c59b5aaa1f84c2a8fdc
diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx
index 90efec0..52357de 100644
--- a/svtools/source/contnr/ivctrl.cxx
+++ b/svtools/source/contnr/ivctrl.cxx
@@ -298,12 +298,12 @@ void SvtIconChoiceCtrl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIc
sal_uLong SvtIconChoiceCtrl::GetEntryCount() const
{
- return _pImp->GetEntryCount();
+ return _pImp ? _pImp->GetEntryCount() : 0;
}
SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( sal_uLong nPos ) const
{
- return _pImp->GetEntry( nPos );
+ return _pImp ? _pImp->GetEntry( nPos ) : NULL;
}
void SvtIconChoiceCtrl::CreateAutoMnemonics( MnemonicGenerator& _rUsedMnemonics )
@@ -313,7 +313,7 @@ void SvtIconChoiceCtrl::CreateAutoMnemonics( MnemonicGenerator& _rUsedMnemonics
SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetSelectedEntry( sal_uLong& rPos ) const
{
- return _pImp->GetFirstSelectedEntry( rPos );
+ return _pImp ? _pImp->GetFirstSelectedEntry( rPos ) : NULL;
}
void SvtIconChoiceCtrl::ClickIcon()
diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx
index 81826ea..87b771a 100644
--- a/vcl/source/window/split.cxx
+++ b/vcl/source/window/split.cxx
@@ -156,8 +156,12 @@ Splitter::~Splitter()
void Splitter::dispose()
{
- TaskPaneList *pTList = GetSystemWindow()->GetTaskPaneList();
- pTList->RemoveWindow( this );
+ SystemWindow *pSysWin = GetSystemWindow();
+ if(pSysWin)
+ {
+ TaskPaneList *pTList = pSysWin->GetTaskPaneList();
+ pTList->RemoveWindow(this);
+ }
Window::dispose();
}
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index bf39c50..7e0b58d 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -181,6 +181,8 @@ bool SystemWindow::PreNotify( NotifyEvent& rNEvt )
TaskPaneList* SystemWindow::GetTaskPaneList()
{
+ if( !mpImplData )
+ return NULL;
if( mpImplData->mpTaskPaneList )
return mpImplData->mpTaskPaneList ;
else
More information about the Libreoffice-commits
mailing list