Fixed crash on window resize for OSX 10.7.x.