Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^6: rmtree() is failing after some time

by gwadej (Chaplain)
on Apr 23, 2009 at 20:46 UTC ( #759660=note: print w/replies, xml ) Need Help??

in reply to Re^5: rmtree() is failing after some time
in thread rmtree() is failing after some time

In general, putting resource teardown code beyond closing a socket or the like in a DESTROY handler is a bit weird.

I have to disagree. If I have resource creation in new or other constructor, I often put cleanup of that resource in DESTROY. If the resource is managed by the object, shouldn't the object do the cleanup?

I guess my C++ background shows here. I see putting the cleanup code in DESTROY as serving to hide those implementation details from the caller of my object. It also tends to reduce the need for cleanup code to be repeated everywhere the object is used (DRY principle).

G. Wade

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2021-12-01 07:22 GMT
Find Nodes?
    Voting Booth?

    No recent polls found