[Skencil-commits] r685 - in skencil/trunk: . Filter Sketch/Modules
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Jun 13 23:03:42 CEST 2006
Author: bh
Date: 2006-06-13 23:03:41 +0200 (Tue, 13 Jun 2006)
New Revision: 685
Modified:
skencil/trunk/ChangeLog
skencil/trunk/Filter/ChangeLog
skencil/trunk/Filter/binfile.c
skencil/trunk/Filter/filterobj.c
skencil/trunk/Filter/subfilefilter.c
skencil/trunk/Filter/zlibfilter.c
skencil/trunk/Sketch/Modules/_libartmodule.c
skencil/trunk/Sketch/Modules/curveobject.c
skencil/trunk/Sketch/Modules/imageobject.c
skencil/trunk/Sketch/Modules/pstokenize.c
skencil/trunk/Sketch/Modules/regionobject.c
skencil/trunk/Sketch/Modules/skaux.c
skencil/trunk/Sketch/Modules/skcolor.c
skencil/trunk/Sketch/Modules/skdither.c
skencil/trunk/Sketch/Modules/skfm.c
skencil/trunk/Sketch/Modules/skpoint.c
skencil/trunk/Sketch/Modules/skrect.c
skencil/trunk/Sketch/Modules/sktrafo.c
skencil/trunk/Sketch/Modules/skvisual.c
Log:
Use Python memory allocation API correctly so that e.g. memory
allocated by PyObject_New is deallocated by PyObject_Del. Also,
use the function based API instead of the macros.
Modified: skencil/trunk/ChangeLog
===================================================================
--- skencil/trunk/ChangeLog 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/ChangeLog 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,3 +1,27 @@
+2006-06-13 Bernhard Herzog <bh at intevation.de>
+
+ * Sketch/Modules/skvisual.c (skvisual_pseudocolor_free)
+ (SKVisual_FromWindow, skvisual_dealloc),
+ Sketch/Modules/sktrafo.c (SKTrafo_FromDouble, sktrafo_dealloc),
+ Sketch/Modules/skrect.c (SKRect_FromDouble, skrect_dealloc),
+ Sketch/Modules/skpoint.c (SKPoint_FromXY, skpoint_dealloc),
+ Sketch/Modules/skfm.c (SKFontMetric_New, skfm_dealloc),
+ Sketch/Modules/skdither.c (SKVisual_InitDither),
+ Sketch/Modules/skcolor.c (fill_free_list, SKColor_FromRGB)
+ (skcolor_dealloc),
+ Sketch/Modules/skaux.c (SKCache_New, SKCache_dealloc),
+ Sketch/Modules/regionobject.c (SKRegion_FromRegion)
+ (region_dealloc),
+ Sketch/Modules/pstokenize.c (PSTokenizer_FromStream)
+ (pstokenizer_dealloc),
+ Sketch/Modules/imageobject.c (image_dealloc, SKImage_FromImage),
+ Sketch/Modules/curveobject.c (SKCurve_New, curve_dealloc),
+ Sketch/Modules/_libartmodule.c (SKSVP_FromArtSVP)
+ (SKSVP_dealloc, SKArtPixBuf_FromArtPixBuf, SKArtPixBuf_dealloc):
+ Use Python memory allocation API correctly so that e.g. memory
+ allocated by PyObject_New is deallocated by PyObject_Del. Also,
+ use the function based API instead of the macros.
+
2006-03-05 Bernhard Herzog <bh at intevation.de>
* Sketch/Editor/doceditor.py, Sketch/UI/canvas.py: Remove unused
Modified: skencil/trunk/Filter/ChangeLog
===================================================================
--- skencil/trunk/Filter/ChangeLog 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Filter/ChangeLog 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,3 +1,13 @@
+2006-06-13 Bernhard Herzog <bh at intevation.de>
+
+ * binfile.c (binfile_dealloc, BinFile_FromStream),
+ filterobj.c (new_filter, filter_dealloc),
+ subfilefilter.c (dealloc_subfile, Filter_SubFileDecode),
+ zlibfilter.c (dealloc_zlib, Filter_FlateDecode):
+ Use Python memory allocation API correctly so that e.g. memory
+ allocated by PyObject_New is deallocated by PyObject_Del. Also,
+ use the function based API instead of the macros.
+
2003-11-20 Bernhard Herzog <bh at intevation.de>
* setup.py: New. Distutils based setup script.
Modified: skencil/trunk/Filter/binfile.c
===================================================================
--- skencil/trunk/Filter/binfile.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Filter/binfile.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1998, 1999, 2001, 2003 by Bernhard Herzog.
+ * Copyright (C) 1998, 1999, 2001, 2003, 2006 by Bernhard Herzog.
*
* All Rights Reserved
*
@@ -277,7 +277,7 @@
binfile_dealloc(BinaryInputObject * self)
{
Py_DECREF(self->stream);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
static PyObject *
@@ -650,7 +650,7 @@
return NULL;
}
- binfile = PyObject_NEW(BinaryInputObject, &BinaryInputType);
+ binfile = PyObject_New(BinaryInputObject, &BinaryInputType);
if (!binfile)
return NULL;
Modified: skencil/trunk/Filter/filterobj.c
===================================================================
--- skencil/trunk/Filter/filterobj.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Filter/filterobj.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -118,15 +118,15 @@
{
FilterObject * self;
- self = PyObject_NEW(FilterObject, &FilterType);
+ self = PyObject_New(FilterObject, &FilterType);
if (!self)
return NULL;
- self->buffer = PyMem_NEW(char, FILTER_BUFSIZE + 1);
+ self->buffer = PyMem_Malloc(FILTER_BUFSIZE + 1);
if (!self->buffer)
{
error:
- PyMem_DEL(self);
+ PyObject_Del(self);
PyErr_NoMemory();
if (dealloc)
dealloc(client_data);
@@ -136,7 +136,7 @@
self->filtername = PyString_FromString(name);
if (!self->filtername)
{
- PyMem_DEL(self->buffer);
+ PyMem_Free(self->buffer);
goto error;
}
@@ -215,8 +215,8 @@
self->dealloc(self->client_data);
Py_DECREF(self->filtername);
Py_DECREF(self->stream);
- PyMem_DEL(self->buffer);
- PyMem_DEL(self);
+ PyMem_Free(self->buffer);
+ PyObject_Del(self);
}
static PyObject *
Modified: skencil/trunk/Filter/subfilefilter.c
===================================================================
--- skencil/trunk/Filter/subfilefilter.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Filter/subfilefilter.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1998, 1999 by Bernhard Herzog.
+ * Copyright (C) 1998, 1999, 2006 by Bernhard Herzog.
*
* All Rights Reserved
*
@@ -90,7 +90,7 @@
{
SubFileDecodeState * state = (SubFileDecodeState*)clientdata;
Py_DECREF(state->delim_object);
- PyMem_DEL(state);
+ PyMem_Free(state);
}
static void
@@ -119,7 +119,7 @@
length = PyString_Size(delim_object);
if (length < 1)
return PyErr_Format(PyExc_ValueError, "empty delimiter");
- state = malloc(sizeof (SubFileDecodeState) + length * sizeof(int));
+ state = PyMem_Malloc(sizeof (SubFileDecodeState) + length * sizeof(int));
if (!state)
return PyErr_NoMemory();
state->delim_object = delim_object;
Modified: skencil/trunk/Filter/zlibfilter.c
===================================================================
--- skencil/trunk/Filter/zlibfilter.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Filter/zlibfilter.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1998, 1999, 2000 by Bernhard Herzog.
+ * Copyright (C) 1998, 1999, 2000, 2006 by Bernhard Herzog.
*
* All Rights Reserved
*
@@ -82,7 +82,8 @@
{
FlateDecodeState * state = (FlateDecodeState*)clientdata;
inflateEnd(&state->zstr); /* XXX error handling */
- PyMem_DEL(state);
+ PyMem_Free(state->buffer);
+ PyMem_Free(state);
}
@@ -96,13 +97,13 @@
if (!PyArg_ParseTuple(args, "O", &target))
return NULL;
- state = PyMem_NEW(FlateDecodeState, 1);
+ state = PyMem_Malloc(sizeof(FlateDecodeState));
if (!state)
return PyErr_NoMemory();
- state->buffer = PyMem_NEW(char, INBUFSIZE);
+ state->buffer = PyMem_Malloc(INBUFSIZE);
if (!state->buffer)
{
- PyMem_DEL(state);
+ PyMem_Free(state);
return PyErr_NoMemory();
}
@@ -132,8 +133,8 @@
"FlateDecode: Zlib Error %i: %.200s",
result, state->zstr.msg);
}
- PyMem_DEL(state->buffer);
- PyMem_DEL(state);
+ PyMem_Free(state->buffer);
+ PyMem_Free(state);
return NULL;
}
Modified: skencil/trunk/Sketch/Modules/_libartmodule.c
===================================================================
--- skencil/trunk/Sketch/Modules/_libartmodule.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/_libartmodule.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 by Bernhard Herzog
+ * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -80,7 +80,7 @@
{
SKSVPObject * self;
- self = PyObject_NEW(SKSVPObject, &SKSVPType);
+ self = PyObject_New(SKSVPObject, &SKSVPType);
if (self == NULL)
return NULL;
@@ -93,7 +93,7 @@
SKSVP_dealloc(SKSVPObject * self)
{
art_svp_free(self->svp);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
static PyObject *
@@ -158,7 +158,7 @@
{
SKArtPixBufObject * self;
- self = PyObject_NEW(SKArtPixBufObject, &SKArtPixBufType);
+ self = PyObject_New(SKArtPixBufObject, &SKArtPixBufType);
if (self == NULL)
return NULL;
@@ -194,7 +194,7 @@
SKArtPixBuf_dealloc(SKArtPixBufObject * self)
{
art_pixbuf_free(self->artpixbuf);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
static PyObject *
Modified: skencil/trunk/Sketch/Modules/curveobject.c
===================================================================
--- skencil/trunk/Sketch/Modules/curveobject.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/curveobject.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -108,7 +108,7 @@
SKCurveObject * self;
int i;
- self = PyObject_NEW(SKCurveObject, &SKCurveType);
+ self = PyObject_New(SKCurveObject, &SKCurveType);
if (self == NULL)
return NULL;
@@ -118,7 +118,7 @@
self->segments = malloc(length * sizeof(CurveSegment));
if (!self->segments)
{
- PyMem_DEL(self);
+ PyObject_Del(self);
return PyErr_NoMemory();
}
self->allocated = length;
@@ -219,7 +219,7 @@
curve_dealloc(SKCurveObject * self)
{
free(self->segments);
- PyMem_DEL(self);
+ PyObject_Del(self);
paths_allocated--;
}
Modified: skencil/trunk/Sketch/Modules/imageobject.c
===================================================================
--- skencil/trunk/Sketch/Modules/imageobject.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/imageobject.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1997, 1998, 1999, 2000, 2003 by Bernhard Herzog
+ * Copyright (C) 1997, 1998, 1999, 2000, 2003, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -131,7 +131,7 @@
{
gdk_image_destroy(self->image);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
PyTypeObject SKImageType = {
@@ -165,7 +165,7 @@
PyObject *
SKImage_FromImage(GdkImage *image)
{
- SKImageObject *self = PyObject_NEW(SKImageObject, &SKImageType);
+ SKImageObject *self = PyObject_New(SKImageObject, &SKImageType);
if (self == NULL)
return NULL;
Modified: skencil/trunk/Sketch/Modules/pstokenize.c
===================================================================
--- skencil/trunk/Sketch/Modules/pstokenize.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/pstokenize.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -734,7 +734,7 @@
{
PSTokenizerObject * self;
- self = PyObject_NEW(PSTokenizerObject, &PSTokenizerType);
+ self = PyObject_New(PSTokenizerObject, &PSTokenizerType);
if (!self)
return NULL;
@@ -751,7 +751,7 @@
pstokenizer_dealloc(PSTokenizerObject * self)
{
Py_DECREF(self->source);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
static PyObject *
Modified: skencil/trunk/Sketch/Modules/regionobject.c
===================================================================
--- skencil/trunk/Sketch/Modules/regionobject.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/regionobject.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1998, 1999, 2000, 2003, 2004 by Bernhard Herzog
+ * Copyright (C) 1998, 1999, 2000, 2003, 2004, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -23,7 +23,7 @@
SKRegion_FromRegion(GdkRegion * region)
{
SKRegionObject *self;
- self = PyObject_NEW(SKRegionObject, &SKRegionType);
+ self = PyObject_New(SKRegionObject, &SKRegionType);
if (self == NULL)
return NULL;
self->region = region;
@@ -233,7 +233,7 @@
region_dealloc(SKRegionObject *self)
{
gdk_region_destroy(self->region);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
Modified: skencil/trunk/Sketch/Modules/skaux.c
===================================================================
--- skencil/trunk/Sketch/Modules/skaux.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/skaux.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -121,14 +121,14 @@
static PyObject *
SKCache_New(void)
{
- SKCacheObject * self = PyObject_NEW(SKCacheObject, &SKCacheType);
+ SKCacheObject * self = PyObject_New(SKCacheObject, &SKCacheType);
if (!self)
return NULL;
self->dict = PyDict_New();
if (!self->dict)
{
- PyMem_DEL(self);
+ PyObject_Del(self);
return NULL;
}
@@ -139,7 +139,7 @@
SKCache_dealloc(SKCacheObject * self)
{
Py_DECREF(self->dict);
- PyMem_DEL(self);
+ PyObject_Del(self);
}
static PyObject *
Modified: skencil/trunk/Sketch/Modules/skcolor.c
===================================================================
--- skencil/trunk/Sketch/Modules/skcolor.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/skcolor.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,4 +1,5 @@
/* Sketch - A Python-based interactive drawing program
+ * Copyright (C) 2006 by Bernhard Herzog
* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
@@ -41,7 +42,7 @@
fill_free_list(void)
{
SKColorObject *p, *q;
- p = PyMem_NEW(SKColorObject, N_COLOROBJECTS);
+ p = PyMem_Malloc(sizeof(SKColorObject) * N_COLOROBJECTS);
if (p == NULL)
return (SKColorObject *)PyErr_NoMemory();
q = p + N_COLOROBJECTS;
@@ -79,7 +80,7 @@
self->ob_type = &SKColorType;
_Py_NewReference(self);
#else
- self = PyObject_NEW(SKColorObject, &SKColorType);
+ self = PyObject_New(SKColorObject, &SKColorType);
if (!self)
return NULL;
#endif
@@ -101,7 +102,7 @@
self->ob_type = (PyTypeObject*)free_list;
free_list = self;
#else
- PyMem_DEL(self);
+ PyObject_Del(self);
#endif
#if SKCOLOR_COUNT_ALLOC
skcolor_allocated--;
Modified: skencil/trunk/Sketch/Modules/skdither.c
===================================================================
--- skencil/trunk/Sketch/Modules/skdither.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/skdither.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1997, 1998, 1999 by Bernhard Herzog
+ * Copyright (C) 1997, 1998, 1999, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -84,22 +84,22 @@
/* alloc the ordered dither arrays for accelerated dithering */
- self->dither_red = PyMem_NEW(SKDitherInfo, 256);
- self->dither_green= PyMem_NEW(SKDitherInfo, 256);
- self->dither_blue = PyMem_NEW(SKDitherInfo, 256);
- self->dither_gray = PyMem_NEW(SKDitherInfo, 256);
+ self->dither_red = PyMem_Malloc(sizeof(SKDitherInfo) * 256);
+ self->dither_green= PyMem_Malloc(sizeof(SKDitherInfo) * 256);
+ self->dither_blue = PyMem_Malloc(sizeof(SKDitherInfo) * 256);
+ self->dither_gray = PyMem_Malloc(sizeof(SKDitherInfo) * 256);
red_ordered_dither = self->dither_red;
green_ordered_dither= self->dither_green;
blue_ordered_dither = self->dither_blue;
gray_ordered_dither = self->dither_gray;
- dither_matrix = PyMem_NEW(unsigned char**, 8);
+ dither_matrix = PyMem_Malloc(sizeof(unsigned char**) * 8);
for (i = 0; i < 8; i++)
{
- dither_matrix[i] = PyMem_NEW(unsigned char*, 8);
+ dither_matrix[i] = PyMem_Malloc(sizeof(unsigned char*) *8);
for (j = 0; j < 8; j++)
- dither_matrix[i][j] = PyMem_NEW(unsigned char, 65);
+ dither_matrix[i][j] = PyMem_Malloc(sizeof(unsigned char) * 65);
}
self->dither_matrix = dither_matrix;
Modified: skencil/trunk/Sketch/Modules/skfm.c
===================================================================
--- skencil/trunk/Sketch/Modules/skfm.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/skfm.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1997, 1998, 2000, 2001, 2003 by Bernhard Herzog
+ * Copyright (C) 1997, 1998, 2000, 2001, 2003, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -75,7 +75,7 @@
{
SKFontMetric * self;
- self = PyObject_NEW(SKFontMetric, &SKFontMetricType);
+ self = PyObject_New(SKFontMetric, &SKFontMetricType);
if (self == NULL)
return NULL;
@@ -85,7 +85,7 @@
static void
skfm_dealloc(SKFontMetric * self)
{
- PyMem_DEL(self);
+ PyObject_Del(self);
}
Modified: skencil/trunk/Sketch/Modules/skpoint.c
===================================================================
--- skencil/trunk/Sketch/Modules/skpoint.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/skpoint.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,4 +1,5 @@
/* Sketch - A Python-based interactive drawing program
+ * Copyright (C) 2006 by Bernhard Herzog
* Copyright (C) 1996, 1997, 1998, 2000, 2001, 2003, 2004 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
@@ -41,7 +42,7 @@
{
SKPointObject * self;
- self = PyObject_NEW(SKPointObject, &SKPointType);
+ self = PyObject_New(SKPointObject, &SKPointType);
if (self == NULL)
return NULL;
@@ -58,7 +59,7 @@
static void
skpoint_dealloc(SKPointObject * self)
{
- PyMem_DEL(self);
+ PyObject_Del(self);
#if SKPOINT_COUNT_ALLOC
allocated -= 1;
#endif
Modified: skencil/trunk/Sketch/Modules/skrect.c
===================================================================
--- skencil/trunk/Sketch/Modules/skrect.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/skrect.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003 by Bernhard Herzog
+ * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -89,7 +89,7 @@
self->ob_type = &SKRectType;
_Py_NewReference(self);
#else
- self = PyObject_NEW(SKRectObject, &SKRectType);
+ self = PyObject_New(SKRectObject, &SKRectType);
if (self == NULL)
return NULL;
#endif
@@ -114,7 +114,7 @@
self->ob_type = (PyTypeObject*)free_list;
free_list = self;
#else
- PyMem_DEL(self);
+ PyObject_Del(self);
#endif
#if SKRECT_COUNT_ALLOC
allocated--;
Modified: skencil/trunk/Sketch/Modules/sktrafo.c
===================================================================
--- skencil/trunk/Sketch/Modules/sktrafo.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/sktrafo.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1997, 1998, 2000, 2002, 2003 by Bernhard Herzog
+ * Copyright (C) 1997, 1998, 2000, 2002, 2003, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -61,7 +61,7 @@
{
SKTrafoObject * self;
- self = PyObject_NEW(SKTrafoObject, &SKTrafoType);
+ self = PyObject_New(SKTrafoObject, &SKTrafoType);
if (self == NULL)
return NULL;
@@ -82,7 +82,7 @@
static void
sktrafo_dealloc(SKTrafoObject * self)
{
- PyMem_DEL(self);
+ PyObject_Del(self);
#if SKTRAFO_COUNT_ALLOC
allocated--;
#endif
Modified: skencil/trunk/Sketch/Modules/skvisual.c
===================================================================
--- skencil/trunk/Sketch/Modules/skvisual.c 2006-06-13 13:11:58 UTC (rev 684)
+++ skencil/trunk/Sketch/Modules/skvisual.c 2006-06-13 21:03:41 UTC (rev 685)
@@ -1,5 +1,5 @@
/* Sketch - A Python-based interactive drawing program
- * Copyright (C) 1997, 1998, 1999, 2000, 2003 by Bernhard Herzog
+ * Copyright (C) 1997, 1998, 1999, 2000, 2003, 2006 by Bernhard Herzog
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -220,20 +220,20 @@
{
for (j = 0; j < 8; j++)
{
- PyMem_DEL(self->dither_matrix[i][j]);
+ PyMem_Free(self->dither_matrix[i][j]);
}
- PyMem_DEL(self->dither_matrix[i]);
+ PyMem_Free(self->dither_matrix[i]);
}
- PyMem_DEL(self->dither_matrix);
+ PyMem_Free(self->dither_matrix);
}
if (self->dither_red)
- PyMem_DEL(self->dither_red);
+ PyMem_Free(self->dither_red);
if (self->dither_green)
- PyMem_DEL(self->dither_green);
+ PyMem_Free(self->dither_green);
if (self->dither_blue)
- PyMem_DEL(self->dither_blue);
+ PyMem_Free(self->dither_blue);
if (self->dither_gray)
- PyMem_DEL(self->dither_gray);
+ PyMem_Free(self->dither_gray);
}
static int
@@ -314,7 +314,7 @@
static PyObject *
SKVisual_FromWindow(GdkWindow * window, PyObject * args)
{
- SKVisualObject * self = PyObject_NEW(SKVisualObject, &SKVisualType);
+ SKVisualObject * self = PyObject_New(SKVisualObject, &SKVisualType);
int result = 0;
if (!self)
@@ -355,7 +355,7 @@
self->free_extra(self);
gdk_visual_unref(self->visual);
gdk_window_unref(self->window);
- PyObject_DEL(self);
+ PyObject_Del(self);
}
static PyObject *
More information about the Skencil-commits
mailing list