add test for %newobject

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8488 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-01-19 08:35:18 +00:00
commit 414989ff28

View file

@ -113,3 +113,15 @@ const char global_const_char_array1[] = CPLUSPLUS_MSG;
const char global_const_char_array2[sizeof(CPLUSPLUS_MSG)+1] = CPLUSPLUS_MSG;
%}
// %typemap(newfree) char *GetNewCharString() { /* hello */ delete[] $1; }
%newobject GetNewCharString();
%inline {
char *GetNewCharString() {
char *nstr = new char[sizeof(CPLUSPLUS_MSG)+1];
strcpy(nstr, CPLUSPLUS_MSG);
return nstr;
}
}