aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2021-03-18 19:39:42 +1100
committerNeil <nyamatongwe@gmail.com>2021-03-18 19:39:42 +1100
commit402e089842d5aa2bb3774a665e26c42dc91fa5b4 (patch)
tree58304e9b27215782eec1a5c38e0636b2a18bafef /win32/PlatWin.cxx
parent43c4b61bdd3669c2cc08d50f10401f0b04befcc9 (diff)
downloadscintilla-mirror-402e089842d5aa2bb3774a665e26c42dc91fa5b4.tar.gz
Use unique_ptr for Surface::Allocate to show transfer of ownership.
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx8
1 files changed, 4 insertions, 4 deletions
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> Surface::Allocate(int technology) {
#if defined(USE_D2D)
if (technology == SCWIN_TECH_GDI)
- return new SurfaceGDI;
+ return std::make_unique<SurfaceGDI>();
else
- return new SurfaceD2D;
+ return std::make_unique<SurfaceD2D>();
#else
- return new SurfaceGDI;
+ return std::make_unique<SurfaceGDI>();
#endif
}