in reply to Re^7: semi-panic: attempt to dup freed string?
in thread semi-panic: attempt to dup freed string?

this creates the SV in the receiver.

Sorry, but could you point out which piece(s) of code are doing that? And what you mean by "in the reciever"?

Also, is the code in the DESTROY method doing anything useful?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^8: semi-panic: attempt to dup freed string?

Replies are listed 'Best First'.
Re^9: semi-panic: attempt to dup freed string?
by ikegami (Patriarch) on Mar 25, 2011 at 20:02 UTC

    By receiver, I meant the Perl interpreter calling get.

    The code (o->sv = newSV(0);) is in new since new is called in the same Perl interpreter as get.

    My DESTROY doesn't do anything useful, but it needs to free the memory new allocated.

      This doesn't detract from the fact that what you've given me works! But I'm still trying to tie down exactly why it works.

      The code (o->sv = newSV(0);) is in new since new is called in the same Perl interpreter as get.

      I'm calling get() in two threads, but new() only in one?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        It's not really in terms of gets and sets. The point is that the SV must be created in a thread that's still around when the SV is last used.