Skip to content

Commit c4ea77e

Browse files
authored
clib.session: Add the GMT_SESSION_NOGDALCLOSE flag to keep GDAL open (#3672)
1 parent aba9a9c commit c4ea77e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pygmt/clib/session.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@ def print_func(file_pointer, message): # noqa: ARG001
400400
self._print_callback = print_func
401401

402402
padding = self["GMT_PAD_DEFAULT"]
403-
session_type = self["GMT_SESSION_EXTERNAL"]
403+
# GMT_SESSION_EXTERNAL: GMT is called by an external wrapper.
404+
# GMT_SESSION_NOGDALCLOSE: Do not call GDALDestroyDriverManager when using GDAL.
405+
session_type = self["GMT_SESSION_EXTERNAL"] + self["GMT_SESSION_NOGDALCLOSE"]
404406
session = c_create_session(name.encode(), padding, session_type, print_func)
405407

406408
if session is None:

0 commit comments

Comments
 (0)