diff options
Diffstat (limited to 'vcl/source/control/spinfld.cxx')
-rw-r--r-- | vcl/source/control/spinfld.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index 85aa37b07769..048f2f4f281c 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -286,7 +286,7 @@ void ImplDrawSpinButton( OutputDevice* pOutDev, void SpinField::ImplInitSpinFieldData() { - mpEdit = NULL; + mpEdit.disposeAndClear(); mbSpin = false; mbRepeat = false; mbUpperIn = false; @@ -311,11 +311,11 @@ void SpinField::ImplInit( vcl::Window* pParent, WinBits nWinStyle ) if ( (nWinStyle & WB_SPIN) && ImplUseNativeBorder( nWinStyle ) ) { SetBackground(); - mpEdit = new Edit( this, WB_NOBORDER ); + mpEdit.set( new Edit( this, WB_NOBORDER ) ); mpEdit->SetBackground(); } else - mpEdit = new Edit( this, WB_NOBORDER ); + mpEdit.set( new Edit( this, WB_NOBORDER ) ); mpEdit->EnableRTL( false ); mpEdit->SetPosPixel( Point() ); @@ -359,7 +359,13 @@ SpinField::SpinField( vcl::Window* pParent, const ResId& rResId ) : SpinField::~SpinField() { - delete mpEdit; + dispose(); +} + +void SpinField::dispose() +{ + mpEdit.disposeAndClear(); + Edit::dispose(); } void SpinField::Up() |