You may want to look into making 'value' mortal. It's been a while since I touched internals but what I think is happening is that the newSVpvn() call is producing as SV with a refcount of one, when it's pushed onto the array this is going up to two, and hence going back down to one when the array is destroyed.. and not being destroyed.
I seem to recall this being discussed in "Extending and Embedding Perl", but I don't have my copy at work so can't check.
In reply to Re: Embedded Perl - Memory leak
by Molt
in thread Embedded Perl - Memory leak
by rajiyer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |