Patrick Dupre wrote: > > Calling a sub from perl, if this sub return an address on an array, > it is not a problem, perl seems to manage correctly the memory to > keep allocated, and I can access to the data through the reference > at any time. > > Making the same call from a CPP method seems not to work. > If I quit the method and keep a value of the returned reference > of the array, a future call to a method trying to access to the > array scratches. > It looks loke that the memory has been desallocated ! > > Am I correct ? > Is thera way to aoid this problem by keeping the memory a live ?
I could guess that you're not incrementing the reference count of the SVs when you store them in the AV, but please show your code as there could be many things wrong here. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/