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. ...@@ -90,7 +90,7 @@ process must skip such objects, rather than deactivating them.
static char cPickleCache_doc_string[] = static char cPickleCache_doc_string[] =
"Defines the PickleCache used by ZODB Connection objects.\n" "Defines the PickleCache used by ZODB Connection objects.\n"
"\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 #define DONT_USE_CPERSISTENCECAPI
#include "cPersistence.h" #include "cPersistence.h"
...@@ -311,8 +311,20 @@ cc_minimize(ccobject *self, PyObject *args) ...@@ -311,8 +311,20 @@ cc_minimize(ccobject *self, PyObject *args)
static void static void
_invalidate(ccobject *self, PyObject *key) _invalidate(ccobject *self, PyObject *key)
{ {
static PyObject *_p_invalidate;
PyObject *v = PyDict_GetItem(self->data, key); 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) if (!v)
return; return;
if (PyType_Check(v)) { if (PyType_Check(v)) {
...@@ -336,7 +348,16 @@ _invalidate(ccobject *self, PyObject *key) ...@@ -336,7 +348,16 @@ _invalidate(ccobject *self, PyObject *key)
PyErr_Clear(); PyErr_Clear();
} }
} else { } 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(); 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