summaryrefslogtreecommitdiffstats
path: root/include/canvas/vclwrapper.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-03 15:57:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-06 08:49:22 +0200
commit96b36edb8963706560a55a5e93a471e39ebd846f (patch)
treedbd1a44d1995b580e5e5094f3f0db812fc7dc008 /include/canvas/vclwrapper.hxx
parentloplugin:useuniqueptr in WW8PLCFx_FactoidBook (diff)
downloadcore-96b36edb8963706560a55a5e93a471e39ebd846f.tar.gz
core-96b36edb8963706560a55a5e93a471e39ebd846f.zip
loplugin:useuniqueptr in VCLObject
Change-Id: Ib31e3ea5c4ac59ff526e85b6156a06130ad20311 Reviewed-on: https://gerrit.libreoffice.org/58572 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/canvas/vclwrapper.hxx')
-rw-r--r--include/canvas/vclwrapper.hxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/canvas/vclwrapper.hxx b/include/canvas/vclwrapper.hxx
index e35cb5fa13b9..77cf8b705e11 100644
--- a/include/canvas/vclwrapper.hxx
+++ b/include/canvas/vclwrapper.hxx
@@ -63,7 +63,7 @@ namespace canvas
// no explicit here. VCLObjects should be freely
// constructible with Wrappees, and AFAIK there is no other
// implicit conversion path that could cause harm here
- VCLObject( Wrappee* pWrappee ) :
+ VCLObject( std::unique_ptr<Wrappee> pWrappee ) :
mpWrappee( pWrappee )
{
}
@@ -122,11 +122,11 @@ namespace canvas
// protecting object deletion with the solar mutex
SolarMutexGuard aGuard;
- delete mpWrappee;
+ mpWrappee.reset();
}
- Wrappee* operator->() { return mpWrappee; }
- const Wrappee* operator->() const { return mpWrappee; }
+ Wrappee* operator->() { return mpWrappee.get(); }
+ const Wrappee* operator->() const { return mpWrappee.get(); }
Wrappee& operator*() { return *mpWrappee; }
const Wrappee& operator*() const { return *mpWrappee; }
@@ -141,7 +141,7 @@ namespace canvas
private:
- Wrappee* mpWrappee;
+ std::unique_ptr<Wrappee> mpWrappee;
};
}