summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/tabctrl.hxx2
-rw-r--r--vcl/source/control/tabctrl.cxx5
2 files changed, 3 insertions, 4 deletions
diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx
index 6286ecea7ef7..6fd7cd3841f5 100644
--- a/include/vcl/tabctrl.hxx
+++ b/include/vcl/tabctrl.hxx
@@ -50,7 +50,7 @@ class ListBox;
class VCL_DLLPUBLIC TabControl : public Control
{
protected:
- ImplTabCtrlData* mpTabCtrlData;
+ std::unique_ptr<ImplTabCtrlData> mpTabCtrlData;
long mnLastWidth;
long mnLastHeight;
long mnMaxPageWidth;
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 13f08e464724..36393f20906c 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -98,7 +98,7 @@ void TabControl::ImplInit( vcl::Window* pParent, WinBits nStyle )
mbFormat = true;
mbRestoreHelpId = false;
mbSmallInvalidate = false;
- mpTabCtrlData = new ImplTabCtrlData;
+ mpTabCtrlData.reset(new ImplTabCtrlData);
mpTabCtrlData->mpListBox = nullptr;
ImplInitSettings( true );
@@ -198,8 +198,7 @@ void TabControl::dispose()
// delete TabCtrl data
if (mpTabCtrlData)
mpTabCtrlData->mpListBox.disposeAndClear();
- delete mpTabCtrlData;
- mpTabCtrlData = nullptr;
+ mpTabCtrlData.reset();
Control::dispose();
}