>-----Original Message-----
>From: Morten Bøgeskov
>
>On Wed, 7 Mar 2001, Kort, Eric wrote:
>><snip>
>> return newRV_inc((SV*)avMask);
>
>
>As I see it.. I mighe be off here, but you create an array (avMask),
>with
>a refcount of 1 and increases the refcount when returning the ref.
>There if only one reference to it in ``perl space'', but count of 2.
>maby newRV_noinc((SV*)avMask); would do it..
What you say is in line with perlguts. However, when I tried newRV_noinc in
the code snippet in question, I got screen fulls of "attempting to free
unreferenced scalar" errors, suggesting that the reference count of the AV*
was going prematurely to 0. Perhaps it is because in this case there is no
pre-existing SV* (I am creating one by casting the AV* to SV*), so it NEEDS
to have its reference count incremented?
I don't really know...newRV_noinc has worked for me in the past, but not
here. Any other ideas, anyone?