Why does creating and removing SKShapeNode and SKNode repeatedly cause a memory leak?

前端 未结 4 533
迷失自我
迷失自我 2021-02-04 18:48

Using the sprite kit template that comes with Xcode, I modify the scene to be as follows :

#import \"MyScene.h\"

@interface MyScene ()
@property (nonatomic,stro         


        
4条回答
  •  被撕碎了的回忆
    2021-02-04 19:15

    I'm using iOS 7.1.1 and had the same problem. However, by setting the SKShapeNode's path property to nil before removing a shape from a parent did fix this issue - no more leaks.

提交回复
热议问题