pygmt.clib.Session.destroy
- Session.destroy()[source]
Destroy the currently open GMT API session.
Warning
Usage of
pygmt.clib.Session
as a context manager in awith
block is preferred over callingpygmt.clib.Session.create
andpygmt.clib.Session.destroy
manually.Calls
GMT_Destroy_Session
to terminate and free the memory of a registeredGMTAPI_CTRL
session (the pointer for this struct is stored in thesession_pointer
attribute).Always use this method after you are done using a C API session. The session needs to be destroyed before creating a new one. Otherwise, some of the configuration files might be left behind and can influence subsequent API calls.
Sets the
session_pointer
attribute toNone
.