Skip to content

Commit 824d861

Browse files
committed
Also need to set the header pointer to None
1 parent f6da405 commit 824d861

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pygmt/clib/session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,9 @@ def virtualfile_from_stringio(self, stringio: io.StringIO):
16871687
try:
16881688
yield vfile
16891689
finally:
1690-
# Must set the text to None to avoid double freeing the memory
1690+
# Must set the pointers to None to avoid double freeing the memory.
1691+
# Maybe upstream bug.
1692+
seg.header = None
16911693
seg.text = None
16921694

16931695
def virtualfile_in( # noqa: PLR0912

0 commit comments

Comments
 (0)