summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcl/pctext.c5
-rw-r--r--pcl/pglabel.c2
-rw-r--r--pxl/pxerrors.c5
-rw-r--r--xps/xpsglyphs.c3
4 files changed, 10 insertions, 5 deletions
diff --git a/pcl/pctext.c b/pcl/pctext.c
index f26b9c2db..e8aa31726 100644
--- a/pcl/pctext.c
+++ b/pcl/pctext.c
@@ -347,8 +347,9 @@ show_char_foreground(
code = gs_text_begin(pcs->pgs, &text, pcs->memory, &penum);
if (code >= 0)
code = gs_text_process(penum);
- gs_text_release(penum, "show_char_foreground");
+ if (code >= 0)
+ gs_text_release(penum, "show_char_foreground");
return code;
}
@@ -463,8 +464,8 @@ show_char_background(
gs_pathbbox(pgs, &bbox);
gs_rectappend(pgs, &bbox, 1);
gs_eofill(pgs);
+ gs_text_release(penum, "show_char_background");
}
- gs_text_release(penum, "show_char_background");
}
pcl_grestore(pcs);
diff --git a/pcl/pglabel.c b/pcl/pglabel.c
index 1060fa683..39fb962b0 100644
--- a/pcl/pglabel.c
+++ b/pcl/pglabel.c
@@ -879,8 +879,8 @@ hpgl_print_char(
"insidedness" - this seems to address the dirty
page issue in practice. */
pcl_mark_page_for_current_pos(pgls);
+ gs_text_release(penum, "hpgl_print_char");
}
- gs_text_release(penum, "hpgl_print_char");
if ( code < 0 )
return code;
gs_setmatrix(pgs, &advance_mat);
diff --git a/pxl/pxerrors.c b/pxl/pxerrors.c
index 85d204a62..a95b9725a 100644
--- a/pxl/pxerrors.c
+++ b/pxl/pxerrors.c
@@ -270,10 +270,13 @@ px_error_page_show(const char *message, int ytop, px_state_t *pxs)
code = gs_text_process(penum);
if ( code > 0 )
code = gs_note_error(errorBadFontData); /* shouldn't happen! */
- gs_text_release(penum, "pxtext");
+ if ( code >= 0 )
+ gs_text_release(penum, "pxtext");
}
gs_scale(pgs, 1 / scale, 1 / scale);
y += point_size * 8 / 5;
+ if (code < 0)
+ break;
if ( !*p || !p[1] )
break;
}
diff --git a/xps/xpsglyphs.c b/xps/xpsglyphs.c
index 6e03930f6..da574946a 100644
--- a/xps/xpsglyphs.c
+++ b/xps/xpsglyphs.c
@@ -195,11 +195,12 @@ xps_flush_text_buffer(xps_context_t *ctx, xps_font_t *font,
return gs_throw1(-1, "cannot gs_text_begin() (%d)", code);
code = gs_text_process(textenum);
- gs_text_release(textenum, "gslt font render");
if (code != 0)
return gs_throw1(-1, "cannot gs_text_process() (%d)", code);
+ gs_text_release(textenum, "gslt font render");
+
buf->count = 0;
return 0;