changeset 68:19f3bc257a25

Added comments for the function holder class.
author Atul Varma <varmaa@toolness.com>
date Sun, 26 Jul 2009 16:24:32 -0700
parents b5160c82be65
children c2972e58fbb6
files function.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/function.c	Sun Jul 26 16:19:12 2009 -0700
+++ b/function.c	Sun Jul 26 16:24:32 2009 -0700
@@ -58,6 +58,10 @@
     Py_DECREF(callable);
 }
 
+// This "Python function holder" JSClass just exists so that it can hold
+// a reference to a Python function for as long as the Python function is
+// callable from JS-land. As soon as it's garbage collected by the JS
+// interpreter, it releases its reference on the Python function.
 static JSClass PYM_JS_FunctionHolderClass = {
   "PymonkeyFunctionHolder", JSCLASS_HAS_RESERVED_SLOTS(1),
   JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,