Skip to content

Commit 57c6774

Browse files
author
sfeam
committed
revert change to cairotrm_reset
1 parent bc6c9c3 commit 57c6774

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2017-09-20 Ethan A Merritt <[email protected]>
2+
3+
* term/cairo.trm (cairotrm_reset): Revert change.
4+
15
2017-09-19 Ethan A Merritt <[email protected]>
26

37
* term/cairo.trm (cairotrm_init cairotrm_reset): Valgrind complained
@@ -6,6 +10,8 @@
610
It does make sense to call it if the terminal has been closed and then
711
reopened. So we fix the ordering of code in cairotrm_init that
812
frees the old plot.cr before reinitializing a new one.
13+
REVERT: This change caused some cairo installations to close pdf output
14+
file without proper termination of the contents.
915

1016
* src/parse.c (parse_array_assignment): Memory leak.
1117

term/cairo.trm

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Hello, Emacs: this is -*-C-*- !
2-
* $Id: cairo.trm,v 1.80 2017-09-19 20:15:10 sfeam Exp $
2+
* $Id: cairo.trm,v 1.81 2017-09-21 18:22:12 sfeam Exp $
33
*/
44

55
/* GNUPLOT - cairo.trm */
@@ -973,13 +973,8 @@ void cairotrm_text()
973973
/* sent when gnuplot exits and when the terminal or the output change.*/
974974
void cairotrm_reset()
975975
{
976-
/* Sep 2017
977-
* valgrind complains that this triggers reads of already-freed data.
978-
* It is unclear whether that is a real problem, but it is also unclear
979-
* that anything is gained by explicit cleanup when we are about to exit.
980-
* Let's try skipping it and see if anyone notices.
981-
*/
982-
/* cairo_destroy(plot.cr); */
976+
if (plot.cr)
977+
cairo_destroy(plot.cr);
983978

984979
#ifdef PSLATEX_DRIVER
985980
/* finish latex output */

0 commit comments

Comments
 (0)