use correct pointer to be closed
Merge pull request #2941 from minggo/iss2304-refator-cclayer

fix a crash on android