magreenblatt wrote:colinChan008 wrote:cache the object in the Js layer doest not help anything, as our cache will retain the object all the time. as a result, the C++ object will not release.
If the JS code releases the reference then the object should be GC'd and the C++ object will be released. That is up to your JS code (e.g. by assigning null to the variable that stores the natively bound object).
if we cache in js, it need me to release manually, but our coder usually won't do this and we can't require they to do this in js too. because it is unhuman.So this suggestion is hard to be performed.