diff --git a/src/Persistence/cPersistence.c b/src/Persistence/cPersistence.c index 623443832edff400633bbe8537fd22f8860793cb..e40a5510c9754fe77182062f817a0e6aa3e5dcd8 100644 --- a/src/Persistence/cPersistence.c +++ b/src/Persistence/cPersistence.c @@ -14,7 +14,7 @@ static char cPersistence_doc_string[] = "Defines Persistent mixin class for persistent objects.\n" "\n" -"$Id: cPersistence.c,v 1.53 2002/04/02 06:01:22 jeremy Exp $\n"; +"$Id: cPersistence.c,v 1.54 2002/04/02 11:11:45 htrd Exp $\n"; #include "cPersistence.h" @@ -190,9 +190,8 @@ deallocated(cPersistentObject *self) /* XXX should just add this to the C API struct */ v = PyObject_CallMethod((PyObject *)self->cache, "_oid_unreferenced", "O", self->oid); - /* XXX What does the comment below mean? */ if (v == NULL) - PyErr_Clear(); /* and explode later */ + PyErr_Clear(); /* I dont think this should ever happen */ else Py_DECREF(v); } diff --git a/src/Persistence/cPickleCache.c b/src/Persistence/cPickleCache.c index 7d8ab648ac5253c10d5359a12f1690c70a2483ae..1d5ca48ae3f4df0e1b32ec424e590de81adcf0b5 100644 --- a/src/Persistence/cPickleCache.c +++ b/src/Persistence/cPickleCache.c @@ -15,7 +15,7 @@ static char cPickleCache_doc_string[] = "Defines the PickleCache used by ZODB Connection objects.\n" "\n" -"$Id: cPickleCache.c,v 1.45 2002/04/02 06:03:39 jeremy Exp $\n"; +"$Id: cPickleCache.c,v 1.46 2002/04/02 11:11:45 htrd Exp $\n"; #define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;} #define UNLESS(E) if(!(E)) @@ -442,11 +442,16 @@ cc_lru_items(ccobject *self, PyObject *args) return l; } -/* XXX What does this function do? */ - static PyObject * cc_oid_unreferenced(ccobject *self, PyObject *args) { + /* This is called by the persistent object deallocation + function when the reference count on a persistent + object reaches zero. We need to fix up our dictionary; + its reference is now dangling because we stole its + reference count. Be careful to not release the global + interpreter lock until this is complete. */ + PyObject *oid, *v; if (!PyArg_ParseTuple(args, "O:_oid_unreferenced", &oid)) return NULL; diff --git a/src/ZODB/cPersistence.c b/src/ZODB/cPersistence.c index 623443832edff400633bbe8537fd22f8860793cb..e40a5510c9754fe77182062f817a0e6aa3e5dcd8 100644 --- a/src/ZODB/cPersistence.c +++ b/src/ZODB/cPersistence.c @@ -14,7 +14,7 @@ static char cPersistence_doc_string[] = "Defines Persistent mixin class for persistent objects.\n" "\n" -"$Id: cPersistence.c,v 1.53 2002/04/02 06:01:22 jeremy Exp $\n"; +"$Id: cPersistence.c,v 1.54 2002/04/02 11:11:45 htrd Exp $\n"; #include "cPersistence.h" @@ -190,9 +190,8 @@ deallocated(cPersistentObject *self) /* XXX should just add this to the C API struct */ v = PyObject_CallMethod((PyObject *)self->cache, "_oid_unreferenced", "O", self->oid); - /* XXX What does the comment below mean? */ if (v == NULL) - PyErr_Clear(); /* and explode later */ + PyErr_Clear(); /* I dont think this should ever happen */ else Py_DECREF(v); } diff --git a/src/ZODB/cPickleCache.c b/src/ZODB/cPickleCache.c index 7d8ab648ac5253c10d5359a12f1690c70a2483ae..1d5ca48ae3f4df0e1b32ec424e590de81adcf0b5 100644 --- a/src/ZODB/cPickleCache.c +++ b/src/ZODB/cPickleCache.c @@ -15,7 +15,7 @@ static char cPickleCache_doc_string[] = "Defines the PickleCache used by ZODB Connection objects.\n" "\n" -"$Id: cPickleCache.c,v 1.45 2002/04/02 06:03:39 jeremy Exp $\n"; +"$Id: cPickleCache.c,v 1.46 2002/04/02 11:11:45 htrd Exp $\n"; #define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;} #define UNLESS(E) if(!(E)) @@ -442,11 +442,16 @@ cc_lru_items(ccobject *self, PyObject *args) return l; } -/* XXX What does this function do? */ - static PyObject * cc_oid_unreferenced(ccobject *self, PyObject *args) { + /* This is called by the persistent object deallocation + function when the reference count on a persistent + object reaches zero. We need to fix up our dictionary; + its reference is now dangling because we stole its + reference count. Be careful to not release the global + interpreter lock until this is complete. */ + PyObject *oid, *v; if (!PyArg_ParseTuple(args, "O:_oid_unreferenced", &oid)) return NULL; diff --git a/src/persistent/cPersistence.c b/src/persistent/cPersistence.c index 623443832edff400633bbe8537fd22f8860793cb..e40a5510c9754fe77182062f817a0e6aa3e5dcd8 100644 --- a/src/persistent/cPersistence.c +++ b/src/persistent/cPersistence.c @@ -14,7 +14,7 @@ static char cPersistence_doc_string[] = "Defines Persistent mixin class for persistent objects.\n" "\n" -"$Id: cPersistence.c,v 1.53 2002/04/02 06:01:22 jeremy Exp $\n"; +"$Id: cPersistence.c,v 1.54 2002/04/02 11:11:45 htrd Exp $\n"; #include "cPersistence.h" @@ -190,9 +190,8 @@ deallocated(cPersistentObject *self) /* XXX should just add this to the C API struct */ v = PyObject_CallMethod((PyObject *)self->cache, "_oid_unreferenced", "O", self->oid); - /* XXX What does the comment below mean? */ if (v == NULL) - PyErr_Clear(); /* and explode later */ + PyErr_Clear(); /* I dont think this should ever happen */ else Py_DECREF(v); } diff --git a/src/persistent/cPickleCache.c b/src/persistent/cPickleCache.c index 7d8ab648ac5253c10d5359a12f1690c70a2483ae..1d5ca48ae3f4df0e1b32ec424e590de81adcf0b5 100644 --- a/src/persistent/cPickleCache.c +++ b/src/persistent/cPickleCache.c @@ -15,7 +15,7 @@ static char cPickleCache_doc_string[] = "Defines the PickleCache used by ZODB Connection objects.\n" "\n" -"$Id: cPickleCache.c,v 1.45 2002/04/02 06:03:39 jeremy Exp $\n"; +"$Id: cPickleCache.c,v 1.46 2002/04/02 11:11:45 htrd Exp $\n"; #define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;} #define UNLESS(E) if(!(E)) @@ -442,11 +442,16 @@ cc_lru_items(ccobject *self, PyObject *args) return l; } -/* XXX What does this function do? */ - static PyObject * cc_oid_unreferenced(ccobject *self, PyObject *args) { + /* This is called by the persistent object deallocation + function when the reference count on a persistent + object reaches zero. We need to fix up our dictionary; + its reference is now dangling because we stole its + reference count. Be careful to not release the global + interpreter lock until this is complete. */ + PyObject *oid, *v; if (!PyArg_ParseTuple(args, "O:_oid_unreferenced", &oid)) return NULL;