Editor: Remove the editor window when rotating the screen

This fix a null pointer exception when rotating the screen