Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
1987c669
Kaydet (Commit)
1987c669
authored
May 29, 2003
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix for SF 742911. We now clear the weakrefs *before* calling __del__
or emptying __dict__, just as we do for classic classes.
üst
aabe0b3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
typeobject.c
Objects/typeobject.c
+12
-11
No files found.
Objects/typeobject.c
Dosyayı görüntüle @
1987c669
...
...
@@ -638,13 +638,6 @@ subtype_dealloc(PyObject *self)
--
_PyTrash_delete_nesting
;
_PyObject_GC_TRACK
(
self
);
/* We'll untrack for real later */
/* Maybe call finalizer; exit early if resurrected */
if
(
type
->
tp_del
)
{
type
->
tp_del
(
self
);
if
(
self
->
ob_refcnt
>
0
)
goto
endlabel
;
}
/* Find the nearest base with a different tp_dealloc
and clear slots while we're at it */
base
=
type
;
...
...
@@ -655,6 +648,18 @@ subtype_dealloc(PyObject *self)
assert
(
base
);
}
/* If we added a weaklist, we clear it. Do this *before* calling
the finalizer (__del__) or clearing the instance dict. */
if
(
type
->
tp_weaklistoffset
&&
!
base
->
tp_weaklistoffset
)
PyObject_ClearWeakRefs
(
self
);
/* Maybe call finalizer; exit early if resurrected */
if
(
type
->
tp_del
)
{
type
->
tp_del
(
self
);
if
(
self
->
ob_refcnt
>
0
)
goto
endlabel
;
}
/* If we added a dict, DECREF it */
if
(
type
->
tp_dictoffset
&&
!
base
->
tp_dictoffset
)
{
PyObject
**
dictptr
=
_PyObject_GetDictPtr
(
self
);
...
...
@@ -667,10 +672,6 @@ subtype_dealloc(PyObject *self)
}
}
/* If we added weaklist, we clear it */
if
(
type
->
tp_weaklistoffset
&&
!
base
->
tp_weaklistoffset
)
PyObject_ClearWeakRefs
(
self
);
/* Finalize GC if the base doesn't do GC and we do */
if
(
!
PyType_IS_GC
(
base
))
_PyObject_GC_UNTRACK
(
self
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment