[KoCo-CVS] [Commit] cjkcodecs/src multibytecodec.c
Brought to you by:
perky
From: Hye-Shik C. <pe...@us...> - 2003-05-27 06:24:42
|
perky 03/05/26 23:24:41 Modified: src multibytecodec.c Log: Fix refcount leaks on destructors of StreamReader and StreamWriter. Revision Changes Path 1.11 +10 -2 cjkcodecs/src/multibytecodec.c Index: multibytecodec.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/multibytecodec.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- multibytecodec.c 20 May 2003 06:42:40 -0000 1.10 +++ multibytecodec.c 27 May 2003 06:24:41 -0000 1.11 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: multibytecodec.c,v 1.10 2003/05/20 06:42:40 perky Exp $ + * $Id: multibytecodec.c,v 1.11 2003/05/27 06:24:41 perky Exp $ */ #include "Python.h" @@ -849,8 +849,12 @@ }; static void -mbstreamreader_dealloc(MultibyteStreamWriterObject *self) +mbstreamreader_dealloc(MultibyteStreamReaderObject *self) { + if (self->errors > ERROR_MAX) { + Py_DECREF(self->errors); + } + Py_DECREF(self->stream); PyObject_Del(self); } @@ -980,6 +984,10 @@ static void mbstreamwriter_dealloc(MultibyteStreamWriterObject *self) { + if (self->errors > ERROR_MAX) { + Py_DECREF(self->errors); + } + Py_DECREF(self->stream); PyObject_Del(self); } |