]> granicus.if.org Git - python/commit
Fix the bug Jeremy was experiencing: both the close() and the
authorGuido van Rossum <guido@python.org>
Wed, 3 Sep 1997 00:09:26 +0000 (00:09 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 3 Sep 1997 00:09:26 +0000 (00:09 +0000)
commit15a40394b0c21829ba9afbb739b2038b8211dabe
tree007e934a360eeac8e87c76c0327d960db81c5fb4
parent2d30840b92d19f2229da75f47a5c7e8cbd254981
Fix the bug Jeremy was experiencing: both the close() and the
dealloc() functions contained code to free/DECREF the buffer
(there were differences between I and O objects but the logic bug was
the same).  Fixed this be setting the buffer pointer to NULL and
testing for that.  (This also makes it safe to call close() more than
once.)

XXX Worry: what if you try to read() or write() once the thing is
closed?
Modules/cStringIO.c