diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-31 12:44:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-31 14:17:09 +0200 |
commit | e5d6351f23c750a351fcb9872b1c582d5327a85f (patch) | |
tree | b4c2a7630d9f0d49df00e7de2941cdf3dd105f77 /canvas | |
parent | 443d24a27842f39b5bc833dbc03082fa52749a2d (diff) |
fix leak in CppunitTest_cppcanvas_test
Change-Id: Iecdbbec18a8d88872878a8fa9a17f7040677384c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99863
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 | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx index 02ab55419d5b..64c65d4cd904 100644 --- a/canvas/source/cairo/cairo_canvas.cxx +++ b/canvas/source/cairo/cairo_canvas.cxx @@ -181,7 +181,13 @@ com_sun_star_comp_rendering_Canvas_Cairo_get_implementation( { auto p = new cairocanvas::Canvas(args, context); p->acquire(); - p->initialize(); + try { + p->initialize(); + } catch (css::uno::Exception&) { + p->dispose(); + p->release(); + throw; + } return static_cast<cppu::OWeakObject*>(p); } |