Corrected an segfault happening when resizing a window displaying the gui