修正内存池对象在进行Destroy时没有解除jsbinding 的问题 #1263
Closed
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.
出现问题是iOS平台,在开发时发现 Fixture对象由于使用了内存池,符合以下条件的话,则出现问题:
1、当Fixture在native端回收,但JSValue没有解除绑定
2、旧的Fixture的地址被新的Fixture使用再绑定到新的JSValue上
3、当旧的 JSValue 被 JSC 进行gc,其JSBinding也被解除,波及了 新的Fixture对象。导致binding消失。
故通过在对其进行回收时,主动调用clearPrivateData进行解除binding.
详见 http://forum.cocos.com/t/undefined-is-not-an-object-evaluating-colliderb-body/60184/12?u=lucky_06