Re: delete_routine() - malfunction or misunderstanding?
- Posted by ghaberek (admin) Mar 12, 2013
- 1401 views
mattlewis said...
You are not assigning the value returned from delete_routine(). So what happens is that its reference count is immediately decremented. Your code should look like:
obj = delete_routine( obj, delete_rid ) -- or: return delete_routine( obj, delete_rid )
Ah-ha! I knew there was a simple trick I was missing. That detail, of all things, should probably be added to the documentation.
And so, while doing as you suggest corrects the first issue, my cleanup routine is not still being called when the program exits, only when I call delete() manually at the end. Any suggestions? Or am I expecting the wrong behavior?
-Greg