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:
parent
d5faf4d89c
commit
a78579ec3f
12 changed files with 288 additions and 156 deletions
|
|
@ -327,7 +327,7 @@ namespace std {
|
|||
|
||||
|
||||
// Methods which can throw an Exception
|
||||
%exception std::vector::vector(int capacity) {
|
||||
%csexception std::vector::vector(int capacity) {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -335,7 +335,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::vector::getitemcopy {
|
||||
%csexception std::vector::getitemcopy {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -343,7 +343,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::vector::getitem {
|
||||
%csexception std::vector::getitem {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -351,7 +351,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::vector::setitem {
|
||||
%csexception std::vector::setitem {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -359,7 +359,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::vector::GetRange {
|
||||
%csexception std::vector::GetRange {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -369,7 +369,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::vector::Insert {
|
||||
%csexception std::vector::Insert {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -377,7 +377,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::vector::InsertRange {
|
||||
%csexception std::vector::InsertRange {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -385,7 +385,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::vector::RemoveAt {
|
||||
%csexception std::vector::RemoveAt {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -393,7 +393,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::vector::Repeat {
|
||||
%csexception std::vector::Repeat {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -401,7 +401,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::vector::RemoveRange {
|
||||
%csexception std::vector::RemoveRange {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -411,7 +411,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::vector::Reverse(int index, int count) {
|
||||
%csexception std::vector::Reverse(int index, int count) {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
@ -421,7 +421,7 @@ namespace std {
|
|||
}
|
||||
}
|
||||
|
||||
%exception std::vector::SetRange {
|
||||
%csexception std::vector::SetRange {
|
||||
try {
|
||||
$action
|
||||
} catch (std::out_of_range& e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue