cocos 3.8 使用 spine 3.8 的时候, Atlas 和 AtlasAttachmentLoaderExtension 对象没有被释放。
使用 spine 4.2 时, Atlas 没有释放。
下面直接贴代码了。
先看 Atlas 的泄漏。
从这里可以看到 Atlas 被 new 出来之后,只是交给了 AttachmentLoader,后续没有其他操作了。
而 AttachmentLoader 相关的代码,没有 delete atlas. 所以导致 atlas 的内存泄漏。
再看 AttachmentLoader
- 在 spine 3.8 版本中, 两种 spine 解析器在使用 loader 作为构造函数参数的情况下,_ownsLoader 都是 false。 在释放的时候,不会释放 _attachmentLoader, 导致内存泄漏。
- 在 spine 4.2 版本中,_ownsLoader 传了 true, 这块没有问题

