[Zodb-checkins] CVS: ZODB3/Persistence - cPickleCache.c:1.85.8.6

Jeremy Hylton jeremy at zope.com
Tue Jul 8 11:36:13 EDT 2003


Update of /cvs-repository/ZODB3/Persistence
In directory cvs.zope.org:/tmp/cvs-serv10342/Persistence

Modified Files:
      Tag: zodb33-devel-branch
	cPickleCache.c 
Log Message:
Initialize pos in cc_clear().
If the cache has been freed in cc_oid_unreferenced(), do nothing.


=== ZODB3/Persistence/cPickleCache.c 1.85.8.5 => 1.85.8.6 ===
--- ZODB3/Persistence/cPickleCache.c:1.85.8.5	Tue Jul  8 09:56:49 2003
+++ ZODB3/Persistence/cPickleCache.c	Tue Jul  8 10:36:05 2003
@@ -452,6 +452,10 @@
 
     PyObject *v;
 
+    /* If the cache has been cleared by GC, data will be NULL. */
+    if (!self->data)
+	return 0;
+
     v = PyDict_GetItem(self->data, oid);
     if (v == NULL) {
 	PyErr_SetObject(PyExc_KeyError, oid);
@@ -600,7 +604,7 @@
 static int
 cc_clear(ccobject *self)
 {
-    int pos;
+    int pos = 0;
     PyObject *k, *v;
     /* Clearing the cache is delicate.
        




More information about the Zodb-checkins mailing list