Commit e449677f authored by Jim Fulton's avatar Jim Fulton

Minor changes including doing an XDECREF in a place where I used to do it.

parent ad9e57bf
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE. DAMAGE.
$Id: ExtensionClass.c,v 1.35 1999/06/10 20:04:40 jim Exp $ $Id: ExtensionClass.c,v 1.36 1999/06/13 12:41:34 jim Exp $
If you have questions regarding this software, If you have questions regarding this software,
contact: contact:
...@@ -54,7 +54,7 @@ static char ExtensionClass_module_documentation[] = ...@@ -54,7 +54,7 @@ static char ExtensionClass_module_documentation[] =
" - They provide access to unbound methods,\n" " - They provide access to unbound methods,\n"
" - They can be called to create instances.\n" " - They can be called to create instances.\n"
"\n" "\n"
"$Id: ExtensionClass.c,v 1.35 1999/06/10 20:04:40 jim Exp $\n" "$Id: ExtensionClass.c,v 1.36 1999/06/13 12:41:34 jim Exp $\n"
; ;
#include <stdio.h> #include <stdio.h>
...@@ -1583,7 +1583,7 @@ CCL_dealloc(PyExtensionClass *self) ...@@ -1583,7 +1583,7 @@ CCL_dealloc(PyExtensionClass *self)
Py_DECREF(self->bases); Py_DECREF(self->bases);
} }
if (((PyExtensionClass*)self->ob_type) != self) Py_DECREF(self->ob_type); if (((PyExtensionClass*)self->ob_type) != self) Py_XDECREF(self->ob_type);
PyMem_DEL(self); PyMem_DEL(self);
} }
...@@ -2012,7 +2012,7 @@ err: ...@@ -2012,7 +2012,7 @@ err:
static PyObject * static PyObject *
CCL_repr(PyExtensionClass *self) CCL_repr(PyExtensionClass *self)
{ {
char p[64], *pp; char p[128], *pp;
PyObject *m; PyObject *m;
if ((m=PyObject_GetAttr(OBJECT(self), py__module__))) if ((m=PyObject_GetAttr(OBJECT(self), py__module__)))
...@@ -2280,7 +2280,7 @@ subclass_hash(PyObject *self) ...@@ -2280,7 +2280,7 @@ subclass_hash(PyObject *self)
static PyObject * static PyObject *
default_subclass_repr(PyObject *self) default_subclass_repr(PyObject *self)
{ {
char p[64], *pp; char p[128], *pp;
PyErr_Clear(); PyErr_Clear();
sprintf(p,"%p",self); sprintf(p,"%p",self);
...@@ -2990,7 +2990,7 @@ subclass_dealloc(PyObject *self) ...@@ -2990,7 +2990,7 @@ subclass_dealloc(PyObject *self)
*/ */
base_dealloced=dealloc_base(self,(PyExtensionClass*)self->ob_type); base_dealloced=dealloc_base(self,(PyExtensionClass*)self->ob_type);
/* We only */ /* We only deallocate ourselves if a base class didn't */
UNLESS(base_dealloced) UNLESS(base_dealloced)
{ {
Py_DECREF(self->ob_type); Py_DECREF(self->ob_type);
...@@ -3416,7 +3416,7 @@ void ...@@ -3416,7 +3416,7 @@ void
initExtensionClass() initExtensionClass()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.35 $"; char *rev="$Revision: 1.36 $";
PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL); PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL);
PMethodType.ob_type=&PyType_Type; PMethodType.ob_type=&PyType_Type;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE. DAMAGE.
$Id: ExtensionClass.c,v 1.35 1999/06/10 20:04:40 jim Exp $ $Id: ExtensionClass.c,v 1.36 1999/06/13 12:41:34 jim Exp $
If you have questions regarding this software, If you have questions regarding this software,
contact: contact:
...@@ -54,7 +54,7 @@ static char ExtensionClass_module_documentation[] = ...@@ -54,7 +54,7 @@ static char ExtensionClass_module_documentation[] =
" - They provide access to unbound methods,\n" " - They provide access to unbound methods,\n"
" - They can be called to create instances.\n" " - They can be called to create instances.\n"
"\n" "\n"
"$Id: ExtensionClass.c,v 1.35 1999/06/10 20:04:40 jim Exp $\n" "$Id: ExtensionClass.c,v 1.36 1999/06/13 12:41:34 jim Exp $\n"
; ;
#include <stdio.h> #include <stdio.h>
...@@ -1583,7 +1583,7 @@ CCL_dealloc(PyExtensionClass *self) ...@@ -1583,7 +1583,7 @@ CCL_dealloc(PyExtensionClass *self)
Py_DECREF(self->bases); Py_DECREF(self->bases);
} }
if (((PyExtensionClass*)self->ob_type) != self) Py_DECREF(self->ob_type); if (((PyExtensionClass*)self->ob_type) != self) Py_XDECREF(self->ob_type);
PyMem_DEL(self); PyMem_DEL(self);
} }
...@@ -2012,7 +2012,7 @@ err: ...@@ -2012,7 +2012,7 @@ err:
static PyObject * static PyObject *
CCL_repr(PyExtensionClass *self) CCL_repr(PyExtensionClass *self)
{ {
char p[64], *pp; char p[128], *pp;
PyObject *m; PyObject *m;
if ((m=PyObject_GetAttr(OBJECT(self), py__module__))) if ((m=PyObject_GetAttr(OBJECT(self), py__module__)))
...@@ -2280,7 +2280,7 @@ subclass_hash(PyObject *self) ...@@ -2280,7 +2280,7 @@ subclass_hash(PyObject *self)
static PyObject * static PyObject *
default_subclass_repr(PyObject *self) default_subclass_repr(PyObject *self)
{ {
char p[64], *pp; char p[128], *pp;
PyErr_Clear(); PyErr_Clear();
sprintf(p,"%p",self); sprintf(p,"%p",self);
...@@ -2990,7 +2990,7 @@ subclass_dealloc(PyObject *self) ...@@ -2990,7 +2990,7 @@ subclass_dealloc(PyObject *self)
*/ */
base_dealloced=dealloc_base(self,(PyExtensionClass*)self->ob_type); base_dealloced=dealloc_base(self,(PyExtensionClass*)self->ob_type);
/* We only */ /* We only deallocate ourselves if a base class didn't */
UNLESS(base_dealloced) UNLESS(base_dealloced)
{ {
Py_DECREF(self->ob_type); Py_DECREF(self->ob_type);
...@@ -3416,7 +3416,7 @@ void ...@@ -3416,7 +3416,7 @@ void
initExtensionClass() initExtensionClass()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.35 $"; char *rev="$Revision: 1.36 $";
PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL); PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL);
PMethodType.ob_type=&PyType_Type; PMethodType.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