diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-10 12:53:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-11 06:55:41 +0000 |
commit | 78b4a1fb01af9ad3b3395a22f6e396be914b553e (patch) | |
tree | 846fdaea907a70fdc274a1e76642ed5e06622c0d /canvas | |
parent | 071e23fee07b92b8f07800cda3ca7e66afe818ae (diff) |
update vclwidget loplugin to find ref-dropping assigment
Look for places where we are accidentally assigning a returned-by-value
VclPtr<T> to a T*, which generally ends up in a use-after-free.
Change-Id: I4f361eaca88820cdb7aa3b8340212db61580fdd9
Reviewed-on: https://gerrit.libreoffice.org/30749
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/cairo/cairo_spritecanvas.cxx | 2 | ||||
-rw-r--r-- | canvas/source/opengl/ogl_spritecanvas.cxx | 2 | ||||
-rw-r--r-- | canvas/source/tools/canvastools.cxx | 2 | ||||
-rw-r--r-- | canvas/source/vcl/windowoutdevholder.cxx | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx index 921850dd7fbf..906c220115ec 100644 --- a/canvas/source/cairo/cairo_spritecanvas.cxx +++ b/canvas/source/cairo/cairo_spritecanvas.cxx @@ -77,7 +77,7 @@ namespace cairocanvas uno::Reference< awt::XWindow > xParentWindow; maArguments[4] >>= xParentWindow; - vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); + VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); if( !pParentWindow ) throw lang::NoSupportException( "Parent window not VCL window, or canvas out-of-process!", nullptr); diff --git a/canvas/source/opengl/ogl_spritecanvas.cxx b/canvas/source/opengl/ogl_spritecanvas.cxx index 7e6bc04c7204..c3bc92a3da7e 100644 --- a/canvas/source/opengl/ogl_spritecanvas.cxx +++ b/canvas/source/opengl/ogl_spritecanvas.cxx @@ -62,7 +62,7 @@ namespace oglcanvas uno::Reference< awt::XWindow > xParentWindow; maArguments[4] >>= xParentWindow; - vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); + VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); if( !pParentWindow ) throw lang::NoSupportException( "Parent window not VCL window, or canvas out-of-process!", nullptr); diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx index 0b874e518e2e..fdf8ab7729a9 100644 --- a/canvas/source/tools/canvastools.cxx +++ b/canvas/source/tools/canvastools.cxx @@ -1141,7 +1141,7 @@ namespace canvas { awt::Rectangle aRetVal( rRect ); - vcl::Window* pWindow = VCLUnoHelper::GetWindow(xWin); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xWin); if( pWindow ) { ::Point aPoint( aRetVal.X, diff --git a/canvas/source/vcl/windowoutdevholder.cxx b/canvas/source/vcl/windowoutdevholder.cxx index 1afde92172f1..4776ee554878 100644 --- a/canvas/source/vcl/windowoutdevholder.cxx +++ b/canvas/source/vcl/windowoutdevholder.cxx @@ -32,7 +32,7 @@ namespace vclcanvas { vcl::Window& windowFromXWin( const uno::Reference<awt::XWindow>& xWin ) { - vcl::Window* pWindow = VCLUnoHelper::GetWindow(xWin); + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xWin); if( !pWindow ) throw lang::NoSupportException( "Parent window not VCL window, or canvas out-of-process!", |