Fix: No longer segfault when closing the window.