in reply to How to test for open file handles?
The way I've tested this in the past is to loop over the suspect code a few thousand times. If it does not die, it's not leaking open files.
Update: Fixed a typo. Thanks GrandFather!