add better director+exception support

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7038 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-03-07 20:47:55 +00:00
commit ca7159f7e7
9 changed files with 203 additions and 108 deletions

View file

@ -65,7 +65,7 @@
Type *ptr = 0;
int res = $input ? asptr_meth($input, &ptr) : 0;
if (!res || !ptr)
throw Swig::DirectorTypeMismatchException("Error converting Python object using asptr_meth");
Swig::DirectorTypeMismatchException::raise("Error converting Python object when using asptr_meth.");
temp = *ptr;
$result = &temp;
if (res == SWIG_NEWOBJ) delete ptr;
@ -75,7 +75,7 @@
Type *ptr = 0;
int res = $input ? asptr_meth($input, &ptr) : 0;
if (!res || !ptr)
throw Swig::DirectorTypeMismatchException("Error converting Python object using asptr_meth");
Swig::DirectorTypeMismatchException::raise("Error converting Python object when using asptr_meth.");
$result = *ptr;
if (res == SWIG_NEWOBJ) delete ptr;
}
@ -84,7 +84,7 @@
Type *ptr = 0;
int res = $input ? asptr_meth($input, &ptr) : 0;
if (!res || !ptr)
throw Swig::DirectorTypeMismatchException("Error converting Python object using asptr_meth");
Swig::DirectorTypeMismatchException::raise("Error converting Python object when using asptr_meth.");
$result = ptr;
if (res == SWIG_NEWOBJ) {
/* Possible thread/reentrant problem here! */