[Pythonmidi-devel] Pyrex experiences?
Status: Pre-Alpha
Brought to you by:
regebro
From: Lennart R. <re...@nu...> - 2004-10-29 10:59:32
|
A big problem popped up yesterday: It turns out that a Python objects __del__ does not necessarily get called when a program exits. I knew this once, but I had forgotten it. This means the ports does not get closed unless you specifically call close on the objects. This is major bug for a Python program, where the garbage collection is supposed to make sure you never have to deallocate resources. It's also makes my computer crash. Not immediatly mind you, but say, 30 minutes later, or so. XP just silently goes *poof* and reboots. NOT fun! (It's probably crappy MIDI drivers that cause this). The solution to this is supposed to be to write the whole python object in C, instead of just wrapping the c methods in a python object. C objects do get properly deallocated when a program exits, I'm told. Now, that means that the C code suddenly gets MUCH more complex (and it wasn't exactly trivial before either) so I'm gonna look at doing this in Pyrex. So, anybody have any interesting experiences with Pyrex? |