From 4d5f8ebfc9daa2aacee4b87c7fd1fdd93a0c6752 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sun, 14 Sep 2014 22:27:08 +0930 Subject: [PATCH 8/9] pdftocairo: win32 hdc should be destroyed after the cairo surface --- utils/pdftocairo.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc index 49e9c1e..2cc4d4e 100644 --- a/utils/pdftocairo.cc +++ b/utils/pdftocairo.cc @@ -658,15 +658,15 @@ static void endDocument() cairo_status_t status; if (printing) { -#ifdef CAIRO_HAS_WIN32_SURFACE - if (print) - win32EndDocument(); -#endif cairo_surface_finish(surface); status = cairo_surface_status(surface); if (status) error(errInternal, -1, "cairo error: {0:s}\n", cairo_status_to_string(status)); cairo_surface_destroy(surface); +#ifdef CAIRO_HAS_WIN32_SURFACE + if (print) + win32EndDocument(); +#endif if (output_file) fclose(output_file); } -- 2.1.0