Delete the window properly so that flash settings are saved and the program doesn't segfault on close all the time. Closes #31