summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-11-21 21:39:29 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-11-21 21:39:29 +0000
commit3a4c187f4dc5a047484b018df56944b1517ccd99 (patch)
treec3c5de6a479e2c5802fd4a41c142ef2949c9ad76
parentFix printing multiple copies of a document (diff)
downloadinkscape-3a4c187f4dc5a047484b018df56944b1517ccd99.tar.gz
inkscape-3a4c187f4dc5a047484b018df56944b1517ccd99.zip
Two fixes (should work on Linux now)
- do not call cairo_show_page as the GtkPrintOperation seems to do that internally (calling it manually will emit the current page, clear it, and the cleared page seems to be emitted in error later) - we can (and should) still call cairo_surface_destroy as it's doing reference counting internally (we increase the reference count in CairoRenderContext::setSurfaceTarget) and won't actually destroy anything until the count reaches zero
-rw-r--r--src/extension/internal/cairo-render-context.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp
index 16100dc88..4869472da 100644
--- a/src/extension/internal/cairo-render-context.cpp
+++ b/src/extension/internal/cairo-render-context.cpp
@@ -882,7 +882,7 @@ CairoRenderContext::finish(bool finish_surface)
{
g_assert( _is_valid );
- if (_vector_based_target)
+ if (_vector_based_target && finish_surface)
cairo_show_page(_cr);
// PDF+TeX Output, see CairoRenderContext::_prepareRenderGraphic()
@@ -898,8 +898,7 @@ CairoRenderContext::finish(bool finish_surface)
if (finish_surface)
cairo_surface_finish(_surface);
cairo_status_t status = cairo_surface_status(_surface);
- if (finish_surface)
- cairo_surface_destroy(_surface);
+ cairo_surface_destroy(_surface);
_surface = NULL;
if (_layout)