diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-22 12:12:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-22 13:40:12 +0100 |
commit | 919e47ee210dc40ae8f235e6904b217b26788f26 (patch) | |
tree | b02331d922c2b296cd6bc2b56ec9291bc6649fe6 /canvas | |
parent | 18aafdd0f936ab6bb4225447a328f5471d143b0d (diff) |
loplugin:refcounting in canvas
Change-Id: I77e4d29b2911bb86c383afbf977d241eaa8cd341
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111307
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/cairo/cairo_canvas.cxx | 4 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_spritecanvas.cxx | 4 | ||||
-rw-r--r-- | canvas/source/opengl/ogl_spritecanvas.cxx | 6 | ||||
-rw-r--r-- | canvas/source/vcl/canvas.cxx | 6 | ||||
-rw-r--r-- | canvas/source/vcl/spritecanvas.cxx | 6 |
5 files changed, 13 insertions, 13 deletions
diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx index f8266cffe446..10edc0681843 100644 --- a/canvas/source/cairo/cairo_canvas.cxx +++ b/canvas/source/cairo/cairo_canvas.cxx @@ -176,7 +176,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* com_sun_star_comp_rendering_Canvas_Cairo_get_implementation( css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args) { - auto p = new cairocanvas::Canvas(args, context); + rtl::Reference<cairocanvas::Canvas> p = new cairocanvas::Canvas(args, context); p->acquire(); try { p->initialize(); @@ -185,7 +185,7 @@ com_sun_star_comp_rendering_Canvas_Cairo_get_implementation( p->release(); throw; } - return static_cast<cppu::OWeakObject*>(p); + return static_cast<cppu::OWeakObject*>(p.get()); } diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx index ddb4491afdf2..91ac7c376b4d 100644 --- a/canvas/source/cairo/cairo_spritecanvas.cxx +++ b/canvas/source/cairo/cairo_spritecanvas.cxx @@ -224,10 +224,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* com_sun_star_comp_rendering_SpriteCanvas_Cairo_get_implementation( css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args) { - auto p = new cairocanvas::SpriteCanvas(args, context); + rtl::Reference<cairocanvas::SpriteCanvas> p = new cairocanvas::SpriteCanvas(args, context); p->acquire(); p->initialize(); - return static_cast<cppu::OWeakObject*>(p); + return static_cast<cppu::OWeakObject*>(p.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/opengl/ogl_spritecanvas.cxx b/canvas/source/opengl/ogl_spritecanvas.cxx index d55625b47668..babeafa19af9 100644 --- a/canvas/source/opengl/ogl_spritecanvas.cxx +++ b/canvas/source/opengl/ogl_spritecanvas.cxx @@ -157,10 +157,10 @@ com_sun_star_comp_rendering_SpriteCanvas_OGL_get_implementation( { if( !OpenGLHelper::supportsOpenGL()) return nullptr; - auto p = new oglcanvas::SpriteCanvas(args, context); - cppu::acquire(p); + rtl::Reference<oglcanvas::SpriteCanvas> p = new oglcanvas::SpriteCanvas(args, context); + cppu::acquire(p.get()); p->initialize(); - return static_cast<cppu::OWeakObject*>(p); + return static_cast<cppu::OWeakObject*>(p.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx index e8f6ffe0c62a..467da51f37ed 100644 --- a/canvas/source/vcl/canvas.cxx +++ b/canvas/source/vcl/canvas.cxx @@ -134,10 +134,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* com_sun_star_comp_rendering_Canvas_VCL_get_implementation( css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args) { - auto p = new vclcanvas::Canvas(args, context); - cppu::acquire(p); + rtl::Reference<vclcanvas::Canvas> p = new vclcanvas::Canvas(args, context); + cppu::acquire(p.get()); p->initialize(); - return static_cast<cppu::OWeakObject*>(p); + return static_cast<cppu::OWeakObject*>(p.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx index bc3b2d9f290a..2238a79127f0 100644 --- a/canvas/source/vcl/spritecanvas.cxx +++ b/canvas/source/vcl/spritecanvas.cxx @@ -163,10 +163,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* com_sun_star_comp_rendering_SpriteCanvas_VCL_get_implementation( css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args) { - auto p = new vclcanvas::SpriteCanvas(args, context); - cppu::acquire(p); + rtl::Reference<vclcanvas::SpriteCanvas> p = new vclcanvas::SpriteCanvas(args, context); + cppu::acquire(p.get()); p->initialize(); - return static_cast<cppu::OWeakObject*>(p); + return static_cast<cppu::OWeakObject*>(p.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |