Destroying a window more than once leads to a nasty segfault, so I implemented a way to avoid it.