Fix crash when quitting from debug build.