summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/ctrl.hxx3
-rw-r--r--vcl/source/control/ctrl.cxx5
2 files changed, 4 insertions, 4 deletions
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
index cb68cfe8f78a..5529cf86b912 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -25,6 +25,7 @@
#include <vcl/dllapi.h>
#include <vcl/window.hxx>
#include <vcl/salnativewidgets.hxx>
+#include <memory>
// forward
namespace vcl { struct ImplControlData; struct ControlLayoutData; }
@@ -34,7 +35,7 @@ class StyleSettings;
class VCL_DLLPUBLIC Control : public vcl::Window
{
protected:
- vcl::ImplControlData* mpControlData;
+ std::unique_ptr<vcl::ImplControlData> mpControlData;
private:
bool mbHasControlFocus;
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index f0f38ac32178..8febfb02975d 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -39,7 +39,7 @@ void Control::ImplInitControlData()
{
mbHasControlFocus = false;
mbShowAccelerator = false;
- mpControlData = new ImplControlData;
+ mpControlData.reset(new ImplControlData);
}
Control::Control( WindowType nType ) :
@@ -62,8 +62,7 @@ Control::~Control()
void Control::dispose()
{
- delete mpControlData;
- mpControlData = nullptr;
+ mpControlData.reset();
Window::dispose();
}