fixed memory leak of gApp