Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^9: perlembed: mortalize an AV, get "Attempt to free unreferenced scalar" - don't mortalize, leaks memory

by demerphq (Chancellor)
on Jul 11, 2006 at 12:38 UTC ( #560428=note: print w/ replies, xml ) Need Help??


in reply to Re^8: perlembed: mortalize an AV, get "Attempt to free unreferenced scalar" - don't mortalize, leaks memory
in thread perlembed: mortalize an AV, get "Attempt to free unreferenced scalar" - don't mortalize, leaks memory

You dont need to increment it as its at refcount 1 when its created, and isn't shared amongst multiple structures. But you do need to decrement if hv_store() fails as otherwise it won't be freed. And if DBI isnt doing that then I suspect its being a little naughty. :-)

AFAIK its really unlikely that hv_store fails so its probably ok. I just like to cover all my bases, especially as when im working on this stuff im usually patching core and somebody like hv or dave_the_m or Rafael or somebody like that will call me on it if I dont. :-)

---
$world=~s/war/peace/g


Comment on Re^9: perlembed: mortalize an AV, get "Attempt to free unreferenced scalar" - don't mortalize, leaks memory

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://560428]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-12-28 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (180 votes), past polls