fix memory leak of cp.PolyShape