<p dir="ltr">Thanks, Geoff.</p>
<p dir="ltr">One more thing, if I use JSRetainPtr for the context, what happens to the values when the context is destroyed? Does the value keep a reference of the context and the context won't be destroyed until all values are garbage collected? Or will the context be destroyed and the value will be in an invalid state, referencing an invalid context?</p>
<br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On 18:24, Mon, Nov 28, 2016 Geoffrey Garen <<a href="mailto:ggaren@apple.com" class="gmail_msg" target="_blank">ggaren@apple.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><p dir="ltr" class="gmail_msg">So I'm asking you guys: what happens with values? Are they just garbage collected? Do they keep a reference of the context or the other way around? Is there a place where I can learn more about JSC besides the code? </p></div></blockquote></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">Values on the stack are garbage collected. If you store a reference to a value in the heap, you need to call JSValueProtect/JSValueUnprotect.</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Geoff</div></div>
</blockquote></div>