modify the c++ global destroy