[Toolkit] fix possible BSOD.