fix crash on leaving viewport with right click hold