Thank you for the response. This confirms that I should check libData->AbortQ()
before trying to use the link form getWSLINK()
.
Just a short explanation of how I ended up (inadvertently) trying to use the link in the middle of an abort:
I am working on an igraph LibraryLink interface. All igraph functions return an error code (just like MathLink functions). I wrapped them all in a function that checks the error code and reports any errors. The reporting is done by calling Message
through getWSLINK
, almost exactly like in the documentation example here. At a later point I added abort support. igraph functions will return an error code when aborted, so due to how things were set up, my program attempted to report this by calling Message
through WSTP. Now I just check for aborts at the beginning of the message function.