对象联合池在释放对象时,可能会无法释放对象 #40

Closed
opened 2026-02-27 13:40:06 +08:00 by lrss3 · 2 comments
Owner

image.png

image.png

在池上释放chart对象引发的。

![image.png](/attachments/77fb9a76-963a-41f6-bc2e-e5cedff84168) <img width="426" alt="image.png" src="attachments/c676413f-61b5-40e4-b57a-6ce1e8fd619c"> 在池上释放chart对象引发的。
Author
Owner
image.png

可能是这个方法中存在问题。

  • 没有检查component是否为null。
  • 合并的if分支可能存在问题。
  • GetComponentInParent 在特定版本上不能找所有父级?
<img width="698" alt="image.png" src="attachments/ed65eb83-0df3-4127-aba4-18b474211518"> 可能是这个方法中存在问题。 * 没有检查component是否为null。 * 合并的if分支可能存在问题。 * GetComponentInParent 在特定版本上不能找所有父级?
151 KiB
Author
Owner

image.png

问题已经修复。

IndirectRelease 会在找到池化对象后调用到 DirectlyRelease 方法上,但看起来可能是 DirectlyRelease 方法没有成功释放导致的。

并且这些方法上已经添加了空检查,避免报错发生在遥远的地方难以排查

![image.png](/attachments/28fb1b9b-dfe8-496b-8470-1dd44d51951e) 问题已经修复。 IndirectRelease 会在找到池化对象后调用到 DirectlyRelease 方法上,但看起来可能是 DirectlyRelease 方法没有成功释放导致的。 并且这些方法上已经添加了空检查,避免报错发生在遥远的地方难以排查
1.6 MiB
lrss3 closed this issue 2026-03-02 13:54:10 +08:00
Sign in to join this conversation.