Fix crash in wxWidgets 2.9 builds.