fix crashes in Carbon windows (OS X)