File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -226,28 +226,26 @@ \subsection{Weak References in Extension Types
226226 0,
227227 "instance",
228228
229- /* lots of stuff omitted for brevity */
229+ /* Lots of stuff omitted for brevity... */
230230
231231 offsetof(PyInstanceObject, in_weakreflist) /* tp_weaklistoffset */
232232};
233233\end {verbatim }
234234
235235The only further addition is that the destructor needs to call the
236- weak reference manager to clear any weak references and return if the
237- object has been resurrected. This needs to occur before any other
238- parts of the destruction have occurred:
236+ weak reference manager to clear any weak references. This should be
237+ done before any other parts of the destruction have occurred:
239238
240239\begin {verbatim }
241240static void
242241instance_dealloc(PyInstanceObject *inst)
243242{
244- /* allocate tempories if needed, but do not begin
245- destruction here
243+ /* Allocate tempories if needed, but do not begin
244+ destruction just yet.
246245 */
247246
248- if (!PyObject_ClearWeakRefs((PyObject *) inst))
249- return;
247+ PyObject_ClearWeakRefs((PyObject *) inst);
250248
251- /* proceed with object destuction normally */
249+ /* Proceed with object destuction normally. */
252250}
253251\end {verbatim }
You can’t perform that action at this time.
0 commit comments