summaryrefslogtreecommitdiff
path: root/vcl/source/control/button.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/control/button.cxx')
-rw-r--r--vcl/source/control/button.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 1fffd4809750..7861656edf90 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -96,13 +96,11 @@ Button::Button( WindowType nType ) :
Button::~Button()
{
dispose();
+ delete mpButtonData;
}
void Button::dispose()
{
- delete mpButtonData;
- mpButtonData = NULL;
-
Control::dispose();
}
@@ -543,7 +541,7 @@ sal_uInt16& Button::ImplGetButtonState()
sal_uInt16 Button::ImplGetButtonState() const
{
- return mpButtonData->mnButtonState;
+ return mpButtonData ? mpButtonData->mnButtonState : 0;
}
void Button::ImplSetSymbolAlign( SymbolAlign eAlign )
@@ -1588,7 +1586,8 @@ void PushButton::SetPressed( bool bPressed )
void PushButton::EndSelection()
{
EndTracking( ENDTRACK_CANCEL );
- if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED )
+ if ( !IsDisposed() &&
+ ImplGetButtonState() & BUTTON_DRAW_PRESSED )
{
ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
if ( !mbPressed )