diff options
-rw-r--r-- | include/vcl/menubtn.hxx | 3 | ||||
-rw-r--r-- | vcl/source/control/menubtn.cxx | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/vcl/menubtn.hxx b/include/vcl/menubtn.hxx index dfbb39962139..99ddf2bdb1e2 100644 --- a/include/vcl/menubtn.hxx +++ b/include/vcl/menubtn.hxx @@ -22,6 +22,7 @@ #include <vcl/button.hxx> #include <vcl/dllapi.h> +#include <memory> class FloatingWindow; class Timer; @@ -34,7 +35,7 @@ class VCL_DLLPUBLIC MenuButton : public PushButton private: friend class VclBuilder; - Timer* mpMenuTimer; + std::unique_ptr<Timer> mpMenuTimer; VclPtr<PopupMenu> mpMenu; VclPtr<Window> mpFloatingWindow; sal_uInt16 mnCurItemId; diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index 5771f24ab289..0b47bf8dfac8 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -96,7 +96,7 @@ MenuButton::~MenuButton() void MenuButton::dispose() { - delete mpMenuTimer; + mpMenuTimer.reset(); mpFloatingWindow.clear(); mpMenu.clear(); PushButton::dispose(); @@ -124,7 +124,7 @@ void MenuButton::MouseButtonDown( const MouseEvent& rMEvt ) { if ( !mpMenuTimer ) { - mpMenuTimer = new Timer("MenuTimer"); + mpMenuTimer.reset(new Timer("MenuTimer")); mpMenuTimer->SetInvokeHandler( LINK( this, MenuButton, ImplMenuTimeoutHdl ) ); } |