fix memory leak of cp.PolyShape

fixed #907