C# exception handling improvements - they are robust and don't leak anymore. Requires typemap modifications using attribute canthrow in any unmanaged code typemaps that throw an exception and excode attribute in csout and csconstruct typemaps.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6934 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-02-02 22:44:32 +00:00
commit bac8f43f79
12 changed files with 288 additions and 156 deletions

View file

@ -2,11 +2,16 @@
%include "exception.i"
#ifdef SWIGCSHARP
#undef %exception
#define %exception %csexception
#endif
/*
last resource, catch everything but don't override
user's throw declarations.
*/
%exception {
try {
$action
@ -31,7 +36,7 @@
struct A
{
/* catched by the user's throw definition */
/* caught by the user's throw definition */
int foo() throw(E1)
{
throw E1();
@ -44,7 +49,7 @@
return 0;
}
/* catched by the %postexception */
/* caught by %postexception */
int foobar()
{
throw E3();