fix director typemaps for wstring&
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9945 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8c3373fb78
commit
0798630f72
1 changed files with 3 additions and 2 deletions
|
|
@ -119,7 +119,7 @@ class wstring;
|
|||
jenv->ReleaseStringChars($input, $1_pstr);
|
||||
%}
|
||||
|
||||
%typemap(directorout) const wstring &
|
||||
%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const wstring &
|
||||
%{if(!$input) {
|
||||
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "null std::wstring");
|
||||
return $null;
|
||||
|
|
@ -127,7 +127,8 @@ class wstring;
|
|||
const jchar *$1_pstr = jenv->GetStringChars($input, 0);
|
||||
if (!$1_pstr) return $null;
|
||||
jsize $1_len = jenv->GetStringLength($input);
|
||||
std::wstring $1_str;
|
||||
/* possible thread/reentrant code problem */
|
||||
static std::wstring $1_str;
|
||||
if ($1_len) {
|
||||
wchar_t *conv_buf = new wchar_t[$1_len];
|
||||
for (jsize i = 0; i < $1_len; ++i) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue