Kaydet (Commit) 96b36edb authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in VCLObject

Change-Id: Ib31e3ea5c4ac59ff526e85b6156a06130ad20311
Reviewed-on: https://gerrit.libreoffice.org/58572
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst fa0f8161
......@@ -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;
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment