Commit 066a1479 authored by Jim Fulton's avatar Jim Fulton

Fixed a bug in the deactivation logic.

parent 293bdf49
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
attributions are listed in the accompanying credits file. attributions are listed in the accompanying credits file.
****************************************************************************/ ****************************************************************************/
static char *what_string = "$Id: cPickleCache.c,v 1.21 1999/05/14 19:41:28 jim Exp $"; static char *what_string = "$Id: cPickleCache.c,v 1.22 1999/06/10 20:35:19 jim Exp $";
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;} #define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E)) #define UNLESS(E) if(!(E))
...@@ -290,7 +290,6 @@ maybegc(ccobject *self, PyObject *thisv) ...@@ -290,7 +290,6 @@ maybegc(ccobject *self, PyObject *thisv)
if (s > 100) s=100; if (s > 100) s=100;
dt=(long)(self->cache_age*(0.2+0.1*s)); dt=(long)(self->cache_age*(0.2+0.1*s));
if (dt < 10) dt=10; if (dt < 10) dt=10;
now=time(NULL);
while (--n >= 0) while (--n >= 0)
{ {
...@@ -351,6 +350,7 @@ _invalidate(ccobject *self, PyObject *key) ...@@ -351,6 +350,7 @@ _invalidate(ccobject *self, PyObject *key)
PyObject_DelAttr(v,py__p_changed) < 0 PyObject_DelAttr(v,py__p_changed) < 0
) )
PyErr_Clear(); PyErr_Clear();
Py_DECREF(v);
} }
else PyErr_Clear(); else PyErr_Clear();
} }
...@@ -623,7 +623,7 @@ void ...@@ -623,7 +623,7 @@ void
initcPickleCache() initcPickleCache()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.21 $"; char *rev="$Revision: 1.22 $";
Cctype.ob_type=&PyType_Type; Cctype.ob_type=&PyType_Type;
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
attributions are listed in the accompanying credits file. attributions are listed in the accompanying credits file.
****************************************************************************/ ****************************************************************************/
static char *what_string = "$Id: cPickleCache.c,v 1.21 1999/05/14 19:41:28 jim Exp $"; static char *what_string = "$Id: cPickleCache.c,v 1.22 1999/06/10 20:35:19 jim Exp $";
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;} #define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E)) #define UNLESS(E) if(!(E))
...@@ -290,7 +290,6 @@ maybegc(ccobject *self, PyObject *thisv) ...@@ -290,7 +290,6 @@ maybegc(ccobject *self, PyObject *thisv)
if (s > 100) s=100; if (s > 100) s=100;
dt=(long)(self->cache_age*(0.2+0.1*s)); dt=(long)(self->cache_age*(0.2+0.1*s));
if (dt < 10) dt=10; if (dt < 10) dt=10;
now=time(NULL);
while (--n >= 0) while (--n >= 0)
{ {
...@@ -351,6 +350,7 @@ _invalidate(ccobject *self, PyObject *key) ...@@ -351,6 +350,7 @@ _invalidate(ccobject *self, PyObject *key)
PyObject_DelAttr(v,py__p_changed) < 0 PyObject_DelAttr(v,py__p_changed) < 0
) )
PyErr_Clear(); PyErr_Clear();
Py_DECREF(v);
} }
else PyErr_Clear(); else PyErr_Clear();
} }
...@@ -623,7 +623,7 @@ void ...@@ -623,7 +623,7 @@ void
initcPickleCache() initcPickleCache()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.21 $"; char *rev="$Revision: 1.22 $";
Cctype.ob_type=&PyType_Type; Cctype.ob_type=&PyType_Type;
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
attributions are listed in the accompanying credits file. attributions are listed in the accompanying credits file.
****************************************************************************/ ****************************************************************************/
static char *what_string = "$Id: cPickleCache.c,v 1.21 1999/05/14 19:41:28 jim Exp $"; static char *what_string = "$Id: cPickleCache.c,v 1.22 1999/06/10 20:35:19 jim Exp $";
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;} #define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E)) #define UNLESS(E) if(!(E))
...@@ -290,7 +290,6 @@ maybegc(ccobject *self, PyObject *thisv) ...@@ -290,7 +290,6 @@ maybegc(ccobject *self, PyObject *thisv)
if (s > 100) s=100; if (s > 100) s=100;
dt=(long)(self->cache_age*(0.2+0.1*s)); dt=(long)(self->cache_age*(0.2+0.1*s));
if (dt < 10) dt=10; if (dt < 10) dt=10;
now=time(NULL);
while (--n >= 0) while (--n >= 0)
{ {
...@@ -351,6 +350,7 @@ _invalidate(ccobject *self, PyObject *key) ...@@ -351,6 +350,7 @@ _invalidate(ccobject *self, PyObject *key)
PyObject_DelAttr(v,py__p_changed) < 0 PyObject_DelAttr(v,py__p_changed) < 0
) )
PyErr_Clear(); PyErr_Clear();
Py_DECREF(v);
} }
else PyErr_Clear(); else PyErr_Clear();
} }
...@@ -623,7 +623,7 @@ void ...@@ -623,7 +623,7 @@ void
initcPickleCache() initcPickleCache()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.21 $"; char *rev="$Revision: 1.22 $";
Cctype.ob_type=&PyType_Type; Cctype.ob_type=&PyType_Type;
......
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