fix random freeze for CG, especially for android

build.