Skip to content

Commit

Permalink
revert change to cairotrm_reset
Browse files Browse the repository at this point in the history
sfeam committed Sep 21, 2017
1 parent bc6c9c3 commit 57c6774
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2017-09-20 Ethan A Merritt <merritt@u.washington.edu>

* term/cairo.trm (cairotrm_reset): Revert change.

2017-09-19 Ethan A Merritt <merritt@u.washington.edu>

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

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

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

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

#ifdef PSLATEX_DRIVER
/* finish latex output */

0 comments on commit 57c6774

Please sign in to comment.