Fix qt5 mac crash.