aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cocoa/PlatCocoa.mm5
-rwxr-xr-xgtk/PlatGTK.cxx5
-rw-r--r--qt/ScintillaEditBase/PlatQt.cpp4
-rw-r--r--src/AutoComplete.cxx2
-rw-r--r--src/Platform.h2
-rw-r--r--win32/PlatWin.cxx5
6 files changed, 10 insertions, 13 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm
index 0c6a96ed1..8e4323dca 100644
--- a/cocoa/PlatCocoa.mm
+++ b/cocoa/PlatCocoa.mm
@@ -1960,9 +1960,8 @@ ListBox::ListBox() noexcept {
ListBox::~ListBox() {
}
-ListBox *ListBox::Allocate() {
- ListBoxImpl *lb = new ListBoxImpl();
- return lb;
+std::unique_ptr<ListBox> ListBox::Allocate() {
+ return std::make_unique<ListBoxImpl>();
}
//--------------------------------------------------------------------------------------------------
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 95cc9e509..2f37cf62d 100755
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -1234,9 +1234,8 @@ public:
void SetList(const char *listText, char separator, char typesep) override;
};
-ListBox *ListBox::Allocate() {
- ListBoxX *lb = new ListBoxX();
- return lb;
+std::unique_ptr<ListBox> ListBox::Allocate() {
+ return std::make_unique<ListBoxX>();
}
static int treeViewGetRowHeight(GtkTreeView *view) {
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp
index 2488d9687..7451a3077 100644
--- a/qt/ScintillaEditBase/PlatQt.cpp
+++ b/qt/ScintillaEditBase/PlatQt.cpp
@@ -1042,9 +1042,9 @@ ListWidget *ListBoxImpl::GetWidget() const noexcept
ListBox::ListBox() noexcept {}
ListBox::~ListBox() {}
-ListBox *ListBox::Allocate()
+std::unique_ptr<ListBox> ListBox::Allocate()
{
- return new ListBoxImpl();
+ return std::make_unique<ListBoxImpl>();
}
ListWidget::ListWidget(QWidget *parent)
: QListWidget(parent), delegate(nullptr)
diff --git a/src/AutoComplete.cxx b/src/AutoComplete.cxx
index 9baf0ab67..102624bbb 100644
--- a/src/AutoComplete.cxx
+++ b/src/AutoComplete.cxx
@@ -43,7 +43,7 @@ AutoComplete::AutoComplete() :
widthLBDefault(100),
heightLBDefault(100),
autoSort(SC_ORDER_PRESORTED) {
- lb.reset(ListBox::Allocate());
+ lb = ListBox::Allocate();
}
AutoComplete::~AutoComplete() {
diff --git a/src/Platform.h b/src/Platform.h
index c0a13d911..3b5b991b0 100644
--- a/src/Platform.h
+++ b/src/Platform.h
@@ -273,7 +273,7 @@ class ListBox : public Window {
public:
ListBox() noexcept;
~ListBox() override;
- static ListBox *Allocate();
+ static std::unique_ptr<ListBox> Allocate();
virtual void SetFont(const Font *font)=0;
virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_, int technology_)=0;
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 00b5c59c5..7b5ece752 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -2573,9 +2573,8 @@ public:
static LRESULT PASCAL StaticWndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam);
};
-ListBox *ListBox::Allocate() {
- ListBoxX *lb = new ListBoxX();
- return lb;
+std::unique_ptr<ListBox> ListBox::Allocate() {
+ return std::make_unique<ListBoxX>();
}
void ListBoxX::Create(Window &parent_, int ctrlID_, Point location_, int lineHeight_, bool unicodeMode_, int technology_) {