From 402e089842d5aa2bb3774a665e26c42dc91fa5b4 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 18 Mar 2021 19:39:42 +1100 Subject: Use unique_ptr for Surface::Allocate to show transfer of ownership. --- win32/PlatWin.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'win32') diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index aac888693..fc4d56cf1 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -2237,14 +2237,14 @@ void SurfaceD2D::SetBidiR2L(bool) { #endif -Surface *Surface::Allocate(int technology) { +std::unique_ptr Surface::Allocate(int technology) { #if defined(USE_D2D) if (technology == SCWIN_TECH_GDI) - return new SurfaceGDI; + return std::make_unique(); else - return new SurfaceD2D; + return std::make_unique(); #else - return new SurfaceGDI; + return std::make_unique(); #endif } -- cgit v1.2.3