4 ms·
GC helps with file handles. Just give the "file" object a destructor that closes the underlying handle.
by Gaelan 9y ago
GC helps with file handles. Just give the "file" object a destructor that closes the underlying handle.
- vpalanc1 9y ago... and, it will be eventually closed. Maybe. Definitely before the program quits. Not sure that it'll be closed before you run out of file handles, though.