Fixed a memleak in the file dialog.