summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/headless/svpvd.cxx5
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,