From 30e8720a235014e96125f9142e5c0a7e628526ce Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 17 Mar 2021 16:55:13 +1100 Subject: Use unique_ptr for ListBox::Allocate to show transfer of ownership. --- win32/PlatWin.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'win32') 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::Allocate() { + return std::make_unique(); } void ListBoxX::Create(Window &parent_, int ctrlID_, Point location_, int lineHeight_, bool unicodeMode_, int technology_) { -- cgit v1.2.3