AnimationLibraryDefination Memory泄漏真人股Kit Arkit

发布于 2025-02-09 18:28:00 字数 796 浏览 2 评论 0原文

因此,我有一个使用RealityKit的Arview。我正在重复使用Arview。我有一个动画的实体(存储在.usdz文件中)。我使用以下代码播放动画。

hummingbird = try! Entity.load(named: "bird")
for animation in hummingbird.availableAnimations {
            hummingbird.playAnimation(animation.repeat(duration: 120.0))
}

但是,我注意到有内存泄漏。使用我发现它是在Playanimation系列中的仪器。 我不知道如何解决此问题。在Arview的结尾,我这样做:

hummingbird.stopAllAnimations(recursive: true)
hummingbird = nil

我认为应该足够。但不是。 在图像中,有两个实例。从运行相同的Arview 2次。

基本上,我的设置是 startvc-> arview-> backtostartvc-> backtosamearview(带有新的配置)。等等。 任何想法都会很棒。如果您有任何疑问或需要澄清。请问。

So I have a ARView using realitykit. I am reusing the ARView. I have a Entity that has animations (stored in .usdz file). I play the animation with the following line of code.

hummingbird = try! Entity.load(named: "bird")
for animation in hummingbird.availableAnimations {
            hummingbird.playAnimation(animation.repeat(duration: 120.0))
}

However, I noticed there is a memory leak. using Instruments I found it was at the playAnimation line.
I have no clue how to fix this. At the end of the ARView I do this:

hummingbird.stopAllAnimations(recursive: true)
hummingbird = nil

I thought that should be enough. But it isn't.
In the image, there are 2 instances. That from running the same arview 2 times.

Memory Image

Basically, my setup is
startVC->ARView->backToStartVC->backToSameARView (with new configuration). And so on.
Any idea would be great. And if you have any questions or need clarification. Please ask.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文