Fix MacOS crash when alt-tabbing

Unchained · published · build 19788524

A fix has been implemented to diminish the crashes in Mac OS when switching focus to another window.