Lisp HUG Maillist Archive

Handling exceptions in a foreign library

Hi all,

I a trying to connect my LW program to a C++ library that has been wrapped into C. Everything works pretty well, excepted when an exception is thrown (and caught) internally in the lib.
In principle, the exception should be caught (in the C++ code), an error info message be generated, and the top-level C function should quietly return.
In reality, throwing the exception seem to completely hang the library (and the calling LW image).
Does anyone have some previous experience in these matters (embedding C++ in C, dealing with C++ exceptions) ?
Thanks in advance,
Best regards,

Jean Bresson




_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Handling exceptions in a foreign library

Does the exception cause the callback to into lisp to happen in a different thread?



On Saturday, May 10, 2014, Jean Bresson <Jean.Bresson@ircam.fr> wrote:

Hi all,

I a trying to connect my LW program to a C++ library that has been wrapped into C. Everything works pretty well, excepted when an exception is thrown (and caught) internally in the lib.
In principle, the exception should be caught (in the C++ code), an error info message be generated, and the top-level C function should quietly return.
In reality, throwing the exception seem to completely hang the library (and the calling LW image).
Does anyone have some previous experience in these matters (embedding C++ in C, dealing with C++ exceptions) ?
Thanks in advance,
Best regards,

Jean Bresson




_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Updated at: 2020-12-10 08:34 UTC