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:
parent
df49ff9f1e
commit
bac8f43f79
12 changed files with 288 additions and 156 deletions
|
|
@ -10,7 +10,13 @@
|
|||
|
||||
%include "exception.i"
|
||||
|
||||
%exception std::deque::getitem {
|
||||
#ifdef SWIGCSHARP
|
||||
#define %genericexception %csexception
|
||||
#else
|
||||
#define %genericexception %exception
|
||||
#endif
|
||||
|
||||
%genericexception std::deque::getitem {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -18,7 +24,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::deque::setitem {
|
||||
%genericexception std::deque::setitem {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -26,7 +32,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::deque::delitem {
|
||||
%genericexception std::deque::delitem {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -34,6 +40,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
#undef %genericexception
|
||||
|
||||
/* This macro defines all of the standard methods for a deque. This
|
||||
is defined as a macro to simplify the task of specialization. For
|
||||
example,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue