Bug 924839 - Reapply the OSX part of the fix to bug 915735

--HG--
extra : rebase_source : 1230fc14e43860cd4d5e4975f08216f6d8d6c7be