[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] C file pointers and file loading
When pygame.image.load is given a Python file object it passes the C
FILE pointer on to SDL by calling SDL_RWFromFP in get_standard_rwop in
rwobject.c. While this has worked so far on Windows it may soon be the
case that SDL will not use the same C run-time as Python. I tried using
an SDL linked to msvcrt with a Python linked to msvcr71 and predictably
the interpreter crashed when loading an image from an open file. Since
great care has been taken in Pygame to separate SDL memory management
from Python's it should also be done for file access. I don't suggest
implementing the changes to rwobject.c immediately, but if it is
necessary I can will do them.
--
Lenard Lindstrom
<len-l@xxxxxxxxx>