vclref: protect vs. double disposes.
Change-Id: I86fe17ad9afba7ee1e87aaa732bebee1746c140f
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 96d1a66..482d3d3 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -334,9 +334,14 @@ void Ruler::dispose()
if ( mnUpdateEvtId )
Application::RemoveUserEvent( mnUpdateEvtId );
delete mpSaveData;
mpSaveData = NULL;
delete mpDragData;
mpDragData = NULL;
if( pAccContext )
{
pAccContext->release();
pAccContext = NULL;
}
Window::dispose();
}
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index b02eb03..adf08f0 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -353,11 +353,16 @@ void SvxRuler::dispose()
pBindings->EnterRegistrations();
for(sal_uInt16 i = 0; i < CTRL_ITEM_COUNT && pCtrlItem[i]; ++i)
delete pCtrlItem[i];
delete[] pCtrlItem;
if (pCtrlItem)
{
for(sal_uInt16 i = 0; i < CTRL_ITEM_COUNT && pCtrlItem[i]; ++i)
delete pCtrlItem[i];
delete[] pCtrlItem;
pCtrlItem = NULL;
}
pBindings->LeaveRegistrations();
Ruler::dispose();
}