Ruby doesn't have "destructors"; this will cause the temporary file to be closed and deleted when the object finalizer is run because it was collected using the garbage collection; that can actually persist for some approximation of forever.

You should probably `close(true)`, `close!`, or `unlink` the file explicitly at this point, as well as freeing it, so that it doesn't linger -- if you are going to bother with an explicit "destroy" of any sort.