diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-15 16:06:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-17 10:16:35 +0200 |
commit | 3b7245007d8c6bbe2cc095ec1c4ce37fd6d05b87 (patch) | |
tree | 2c9032ecff5003a798e5cf1b29044ccd5224cf10 /vcl | |
parent | 812aa0512d0f77673b4ccda1187cccd0c9352e48 (diff) |
loplugin:useuniqueptr in X11SalVirtualDevice
Change-Id: I812fb31ec802d2c20e2e82693be127d42df73a69
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/salvd.h | 2 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salvd.cxx | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/vcl/inc/unx/salvd.h b/vcl/inc/unx/salvd.h index 49b3ddff2d02..dbc489f63aab 100644 --- a/vcl/inc/unx/salvd.h +++ b/vcl/inc/unx/salvd.h @@ -32,7 +32,7 @@ class X11SalGraphics; class X11SalVirtualDevice : public SalVirtualDevice { SalDisplay *pDisplay_; - X11SalGraphics *pGraphics_; + std::unique_ptr<X11SalGraphics> pGraphics_; Pixmap hDrawable_; SalX11Screen m_nXScreen; diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx index 09367e1e8a25..3be1449de90f 100644 --- a/vcl/unx/generic/gdi/salvd.cxx +++ b/vcl/unx/generic/gdi/salvd.cxx @@ -171,8 +171,7 @@ X11SalVirtualDevice::X11SalVirtualDevice(SalGraphics const * pGraphics, long &nD X11SalVirtualDevice::~X11SalVirtualDevice() { - delete pGraphics_; - pGraphics_ = nullptr; + pGraphics_.reset(); if( GetDrawable() && !bExternPixmap_ ) XFreePixmap( GetXDisplay(), GetDrawable() ); @@ -186,7 +185,7 @@ SalGraphics* X11SalVirtualDevice::AcquireGraphics() if( pGraphics_ ) bGraphics_ = true; - return pGraphics_; + return pGraphics_.get(); } void X11SalVirtualDevice::ReleaseGraphics( SalGraphics* ) |