Browse Source

[trac983] clarified comments on refcount of some python constant objects.

JINMEI Tatuya 13 years ago
parent
commit
673a619cd6
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/lib/python/isc/acl/acl.cc

+ 5 - 3
src/lib/python/isc/acl/acl.cc

@@ -60,9 +60,11 @@ PyInit_acl(void) {
         po_LoaderError = PyErr_NewException("isc.acl.LoaderError", NULL, NULL);
         po_LoaderError = PyErr_NewException("isc.acl.LoaderError", NULL, NULL);
         PyObjectContainer(po_LoaderError).installToModule(mod, "LoaderError");
         PyObjectContainer(po_LoaderError).installToModule(mod, "LoaderError");
 
 
-        // Install module constants.  Note that we can release our own
-        // references to these objects because we don't have corresponding
-        // C++ variables.
+        // Install module constants.  Note that we can let Py_BuildValue
+        // "steal" the references to these object (by specifying false to
+        // installToModule), because, unlike the exception cases above,
+        // we don't have corresponding C++ variables (see the note in
+        // pycppwrapper_util for more details).
         PyObjectContainer(Py_BuildValue("I", isc::acl::ACCEPT)).
         PyObjectContainer(Py_BuildValue("I", isc::acl::ACCEPT)).
             installToModule(mod, "ACCEPT", false);
             installToModule(mod, "ACCEPT", false);
         PyObjectContainer(Py_BuildValue("I", isc::acl::REJECT)).
         PyObjectContainer(Py_BuildValue("I", isc::acl::REJECT)).