pull/2/head
jaysunxiao 2022-01-09 15:03:09 +08:00
parent 9ce7e96120
commit ec8d68cd8c
1 changed files with 4 additions and 0 deletions

View File

@ -4,6 +4,8 @@
- 引用计数对象继承于Reference当没有引用时会被自动回收
- 非引用计数对象没有继承于Reference自能自己手动回收,free或queue_free
- 在godot中移除一个节点并不会从节点中删除必须手动调用free或queue_free
![Image text](image/gc.JPG)
# 2. 垃圾回收的缺点
@ -12,6 +14,8 @@
![Image text](image/gc2.png)
![Image text](image/gc3.png)
- GdScript没有垃圾回收虽然有着内存泄露的风险但是也保证了性能
# 3. 引用计数
- 可以使用unreference去释放引用计数的对象