fix directorout typemap for const std::string&. Adding warning about the new typemap, which is not thread safe

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6872 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-12-13 20:22:19 +00:00
commit c98340f0a7
7 changed files with 73 additions and 5 deletions

View file

@ -77,12 +77,12 @@
$result = *ptr;
if (res == SWIG_NEWOBJ) delete ptr;
}
%typemap(directorout,fragment=pyfrag) const __VA_ARGS__& ($*1_ltype temp) {
%typemap(directorout,fragment=pyfrag,warning="470:Using thread unsafe wrapping, consider using a lvalue return type.") const __VA_ARGS__& {
__VA_ARGS__ *ptr = 0;
int res = asptr_meth($input, &ptr);
if (!res || !ptr)
throw Swig::DirectorTypeMismatchException("Error converting Python object using asptr_meth");
temp = *ptr;
static $*1_ltype temp = *ptr;
$result = &temp;
if (res == SWIG_NEWOBJ) delete ptr;
}