On Fri, Mar 02, 2001 at 04:56:01PM -0500, "Kort, Eric" wrote:
> The perlapi documentation states:
>             The return value will be NULL if the operation failed or if the
>             value did not need to be actually stored within the array (as in
>             the case of tied arrays). Otherwise it can be dereferenced to
>             get the original `SV*'. Note that the caller is responsible for
>             suitably incrementing the reference count of `val' before the
>             call, and decrementing it if the function returned NULL.

I hope I'm not introducing potential memory leaks in my code by not
checking for NULL. (for tied arrays)

> So I want to see if it returned NULL, but I don't know how.  If I try:
>   svReturnVal = av_store(avArray, 2, svNewVal); //svReturnVal is an SV**
> and then: 
>   iReturnVal = SvIV(*svReturnVal); //iReturnVal is an int

    if (av_store(avArray, 2, svNewVal) == NULL)
        SvREFCNT_dec(svNewVal);

Perhaps?

mark

-- 
[EMAIL PROTECTED][EMAIL PROTECTED][EMAIL PROTECTED] __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | SIR Tools          (7H12)
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | Nortel Networks
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada

  One ring to rule them all, one ring to find them, one ring to bring them all
                       and in the darkness bind them...

                           http://mark.mielke.cc/

Reply via email to