SKPhysicsBody bodyWithPolygonFromPath memory leaks <p>I have a strange memory leaks when creating Sprite Kit physics bodies with custom shapes. This is how my implementation looks:</p> <pre><code>CGFloat offsetX = self.frame.size.width * self.anchorPoint.x; CGFloat offsetY = self.frame.size.height * self.anchorPoint.y; CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path, NULL, 4 - offsetX, 3 - offsetY); CGPathAddLineToPoint(path, NULL, 66 - offsetX, 3 - offsetY); CGPathAddLineToPoint(path, NULL, 35 - offsetX, 57 - offsetY); CGPathCloseSubpath(path); self.physicsBody = [SKPhysicsBody bodyWithPolygonFromPath:path]; CGPathRelease(path); </code></pre> <p>Everything is going on inside <code>SKSpriteNode</code> method. Instruments tells me about several memory leaks after creating such bodies:</p> <pre><code>Leaked object: Malloc 32 Bytes Size: 32 Bytes Responsible Library: PhysicsKit Responsible Frame: std::__1::__split_buffer&lt;PKPoint, std::__1::allocator&lt;PKPoint&gt;&amp;&gt;::__split_buffer(unsigned long, unsigned long, std::__1::allocator&lt;PKPoint&gt;&amp;) </code></pre> <p>The <code>CGPathRelease(path);</code> line is necessary - without it I'm getting more memory leaks about <code>CGPath</code> which is understandable. When I'm using this implementation instead (for testing purposes):</p> <pre><code>CGFloat radius = MAX(self.frame.size.width, self.frame.size.height) * 0.5f; self.physicsBody = [SKPhysicsBody bodyWithCircleOfRadius:radius]; </code></pre> <p>...everything is working well, without memory leaks. I wonder if this is Sprite Kit bug or I'm doing something wrong.</p>