Commit 23c00f1
authored
fix(unity/pesapi-v8): Reset value_persistent in pesapi_release_value_ref (#2342)
v8::Persistent uses NonCopyablePersistentTraits (kResetInDestructor == false), so the implicit ~pesapi_value_ref__() does not release the strong V8 global root. pesapi_release_value_ref freed the C++ struct but never Reset the persistent, so a JS function marshaled into a C# delegate (this path never calls pesapi_set_ref_weak, the persistent stays strong) and everything its closure captures leaked for the isolate lifetime. Affects native backends; WebGL (JS-mock ObjectPool) is unaffected. Add explicit value_persistent.Reset().1 parent a9a5564 commit 23c00f1
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
695 | 700 | | |
696 | 701 | | |
697 | 702 | | |
| |||
0 commit comments