diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-02-09 18:19:14 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-02-09 18:19:14 +0100 |
commit | 44503ecd59d5bc6b96e7948eede240c0314e5dcf (patch) | |
tree | c670cc03a89c8b2ba8a8f8b906de06b73191f38e /vcl/headless/svpvd.cxx | |
parent | 721f53712a2b291c559b7ae42bc17538ca5bc8ac (diff) |
Don't leak old m_pSurface
Change-Id: Ief35b95af3da58845291ab27b4eb09895e0256a2
Diffstat (limited to 'vcl/headless/svpvd.cxx')
-rw-r--r-- | vcl/headless/svpvd.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx index 7840aecc3807..f356d7dfbb3e 100644 --- a/vcl/headless/svpvd.cxx +++ b/vcl/headless/svpvd.cxx @@ -66,6 +66,11 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, if (!m_pSurface || cairo_image_surface_get_width(m_pSurface) != aDevSize.getX() || cairo_image_surface_get_height(m_pSurface) != aDevSize.getY() ) { + if (m_pSurface) + { + cairo_surface_destroy(m_pSurface); + } + if (m_eFormat == DeviceFormat::BITMASK) { m_pSurface = cairo_image_surface_create(CAIRO_FORMAT_A1, |