summaryrefslogtreecommitdiff
path: root/src/drivers/PostScript/Fl_PostScript.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-05-05 11:34:10 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-05-05 11:34:10 +0200
commitaf91083a7fd15100ef04b66b521c321249143580 (patch)
treeee0f287a2febf1afc79037983f3959010983de03 /src/drivers/PostScript/Fl_PostScript.cxx
parente02ee7d5f11b31024e1fe91cf980a90641b1a2c4 (diff)
Fl_Cairo_Graphics_Driver: simpler code with early calls to cairo_surface_destroy().
Add also replacement for pango_font_metrics_get_height() which requires Pango 1.44
Diffstat (limited to 'src/drivers/PostScript/Fl_PostScript.cxx')
-rw-r--r--src/drivers/PostScript/Fl_PostScript.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/drivers/PostScript/Fl_PostScript.cxx b/src/drivers/PostScript/Fl_PostScript.cxx
index 6e233ef97..918dbcd6c 100644
--- a/src/drivers/PostScript/Fl_PostScript.cxx
+++ b/src/drivers/PostScript/Fl_PostScript.cxx
@@ -1458,6 +1458,7 @@ static int init_cairo_postscript(FILE* output, cairo_t* &cairo_,
if (cairo_surface_status(cs) != CAIRO_STATUS_SUCCESS) return 1;
cairo_ps_surface_restrict_to_level(cs, CAIRO_PS_LEVEL_2);
cairo_ = cairo_create(cs);
+ cairo_surface_destroy(cs);
driver->Fl_Cairo_Graphics_Driver::font(0, 0); // to create the PangoLayout
return 0;
}
@@ -1667,7 +1668,6 @@ void Fl_PostScript_File_Device::end_job (void)
fputs("\n", ps->output); // creates an stdio error
}
cairo_destroy(ps->cr());
- cairo_surface_destroy(s);
if (!error) error = fflush(ps->output);
#else
if (ps->nPages) { // for eps nPages is 0 so it is fine ....
@@ -1734,7 +1734,6 @@ int Fl_EPS_File_Surface::close() {
cairo_surface_finish(s);
cairo_status_t status = cairo_surface_status(s);
cairo_destroy(ps->cr());
- cairo_surface_destroy(s);
fflush(ps->output);
error = ferror(ps->output);
if (status != CAIRO_STATUS_SUCCESS) error = status;