fix #27841:Crashing on enabling swing fixed