onRestart in debugger crashes game with cpp