Commit bef5af54 authored by Jeremy Hylton's avatar Jeremy Hylton

Call _p_invalidate() instead of indirecting through _p_changed.

parent a2acdc03
......@@ -90,7 +90,7 @@ process must skip such objects, rather than deactivating them.
static char cPickleCache_doc_string[] =
"Defines the PickleCache used by ZODB Connection objects.\n"
"\n"
"$Id: cPickleCache.c,v 1.90 2004/03/02 15:37:38 jeremy Exp $\n";
"$Id: cPickleCache.c,v 1.91 2004/03/02 22:13:54 jeremy Exp $\n";
#define DONT_USE_CPERSISTENCECAPI
#include "cPersistence.h"
......@@ -311,8 +311,20 @@ cc_minimize(ccobject *self, PyObject *args)
static void
_invalidate(ccobject *self, PyObject *key)
{
static PyObject *_p_invalidate;
PyObject *v = PyDict_GetItem(self->data, key);
if (!_p_invalidate) {
_p_invalidate = PyString_InternFromString("_p_invalidate");
if (!_p_invalidate) {
/* It doesn't make any sense to ignore this error, but
the caller ignores all errors.
*/
PyErr_Clear();
return;
}
}
if (!v)
return;
if (PyType_Check(v)) {
......@@ -336,7 +348,16 @@ _invalidate(ccobject *self, PyObject *key)
PyErr_Clear();
}
} else {
if (PyObject_DelAttr(v, py__p_changed) < 0)
PyObject *meth, *err;
meth = PyObject_GetAttr(v, _p_invalidate);
if (!meth) {
PyErr_Clear();
return;
}
err = PyObject_CallObject(meth, NULL);
Py_DECREF(meth);
if (!err)
PyErr_Clear();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment