[Zodb-checkins] CVS: ZODB4/Persistence - cPersistence.c:1.30

Jeremy Hylton jeremy@zope.com
Fri, 22 Nov 2002 17:23:43 -0500


Update of /cvs-repository/ZODB4/Persistence
In directory cvs.zope.org:/tmp/cvs-serv19984/Persistence

Modified Files:
	cPersistence.c 
Log Message:
Free the __dict__ of a ghost.

This is a simple change that seems to have been delayed for no good
reason.  It could lead to perplexing crashes, however.  I've tested on
a couple of Python versions, bu not on Windows.  We should be a little
suspicious of this change until it's seen more testing.



=== ZODB4/Persistence/cPersistence.c 1.29 => 1.30 ===
--- ZODB4/Persistence/cPersistence.c:1.29	Fri Nov 22 16:47:59 2002
+++ ZODB4/Persistence/cPersistence.c	Fri Nov 22 17:23:43 2002
@@ -219,11 +219,8 @@
     if (self->po_state == UPTODATE && self->po_dm) {
 	PyObject **pdict = _PyObject_GetDictPtr((PyObject *)self);
 	if (pdict && *pdict) {
-/* Would prefer to free the dict, but need to extend other parts of
-   the implementation to check for the dict's existence.
-*/
-/*	    Py_DECREF(*pdict); */
-	    PyDict_Clear(*pdict);
+	    Py_DECREF(*pdict);
+	    *pdict = NULL;
 	}
 	self->po_state = GHOST;
     }