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@6934 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-02-02 22:44:32 +00:00
commit a78579ec3f
12 changed files with 288 additions and 156 deletions

View file

@ -15,14 +15,15 @@
%typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & ""
%typemap(throws) const enum SWIGTYPE & %{
%typemap(throws, canthrow=1) const enum SWIGTYPE & %{
(void)$1;
SWIG_CSharpThrowException(SWIG_CSharpException, "C++ $1_type exception thrown");
%}
%typemap(csin) const enum SWIGTYPE & "(int)$csinput"
%typemap(csout) const enum SWIGTYPE & {
return ($*csclassname)$imcall;
%typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & {
$*csclassname ret = ($*csclassname)$imcall;$excode
return ret;
}
%typemap(csvarout) const enum SWIGTYPE & %{
@ -41,14 +42,15 @@
%typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE ""
%typemap(throws) enum SWIGTYPE %{
%typemap(throws, canthrow=1) enum SWIGTYPE %{
(void)$1;
SWIG_CSharpThrowException(SWIG_CSharpException, "C++ $1_type exception thrown");
%}
%typemap(csin) enum SWIGTYPE "(int)$csinput"
%typemap(csout) enum SWIGTYPE {
return ($csclassname)$imcall;
%typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE {
$csclassname ret = ($csclassname)$imcall;$excode
return ret;
}
%typemap(csvarout) enum SWIGTYPE %{