diff options
author | Fred Drake <fdrake@acm.org> | 2001-06-22 17:20:29 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-06-22 17:20:29 (GMT) |
commit | f66cb5d0eb79083ceaa4b6a1eac6928ce2ebb1e7 (patch) | |
tree | bb7ee1c017f453add0fbec05cad424181dce3efe | |
parent | 9ca78ac57fbebcedba27c0f4487d295527b1f367 (diff) | |
download | cpython-f66cb5d0eb79083ceaa4b6a1eac6928ce2ebb1e7.zip cpython-f66cb5d0eb79083ceaa4b6a1eac6928ce2ebb1e7.tar.gz cpython-f66cb5d0eb79083ceaa4b6a1eac6928ce2ebb1e7.tar.bz2 |
Corrected an error in the information on supporting weak references in
extension types (the docs reflected a development version of the API).
This closes SF bug #435066.
-rw-r--r-- | Doc/lib/libweakref.tex | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Doc/lib/libweakref.tex b/Doc/lib/libweakref.tex index 077e25c..0d92ea9 100644 --- a/Doc/lib/libweakref.tex +++ b/Doc/lib/libweakref.tex @@ -226,28 +226,26 @@ PyTypeObject PyInstance_Type = { 0, "instance", - /* lots of stuff omitted for brevity */ + /* Lots of stuff omitted for brevity... */ offsetof(PyInstanceObject, in_weakreflist) /* tp_weaklistoffset */ }; \end{verbatim} The only further addition is that the destructor needs to call the -weak reference manager to clear any weak references and return if the -object has been resurrected. This needs to occur before any other -parts of the destruction have occurred: +weak reference manager to clear any weak references. This should be +done before any other parts of the destruction have occurred: \begin{verbatim} static void instance_dealloc(PyInstanceObject *inst) { - /* allocate tempories if needed, but do not begin - destruction here + /* Allocate tempories if needed, but do not begin + destruction just yet. */ - if (!PyObject_ClearWeakRefs((PyObject *) inst)) - return; + PyObject_ClearWeakRefs((PyObject *) inst); - /* proceed with object destuction normally */ + /* Proceed with object destuction normally. */ } \end{verbatim} |