Fix in Perl out-typemap for std::vector (thanks to Josh Cherry)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5980 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
60f4c8988e
commit
13374b6a80
1 changed files with 2 additions and 1 deletions
|
|
@ -139,8 +139,9 @@ namespace std {
|
||||||
int len = $1.size();
|
int len = $1.size();
|
||||||
SV **svs = new SV*[len];
|
SV **svs = new SV*[len];
|
||||||
for (unsigned int i=0; i<len; i++) {
|
for (unsigned int i=0; i<len; i++) {
|
||||||
|
T* ptr = new T($1[i]);
|
||||||
svs[i] = sv_newmortal();
|
svs[i] = sv_newmortal();
|
||||||
SWIG_MakePtr(svs[i], (void*)&($1[i]),
|
SWIG_MakePtr(svs[i], (void*) ptr,
|
||||||
$descriptor(T *), $shadow|$owner);
|
$descriptor(T *), $shadow|$owner);
|
||||||
}
|
}
|
||||||
AV *myav = av_make(len, svs);
|
AV *myav = av_make(len, svs);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue