Fixed a memory leak in the file dialog.