Program "crashes" when I setResizable(true) and resize the Window

no I need draw to loop