防止uclass被gc时,误清在mark和sweeep之间新建的同名uclass信息 #184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
你好,实际使用中有以下一种特殊情况
第一步:UE开始GC,执行mark,把uclass作为垃圾,标记为unreachable
第二步:新的同名uclass对象被创建,注册到unlua,对应的Actor被push到lua中
第三步:UE执行分帧清理第一步GC扫描到的垃圾,垃圾uclass删除,Name2Classes被清空。但此时Name2Classes存储的value为新的uclass,并不是垃圾uclass
第四步:lua中新uclass对应Actor执行到GetField,会因为Name2Classes没有Name而check失败
我的想法是只在清Name2Classes时判断,其他ClassMetaTable等照清,顶多之后重新注册一遍,不知合不合适。