open x server connections

hi,

i have come across the following problem:

matplotlib leaves open x server connections with various backends.
even after i del all relevant objects and del pylab. sometimes (the
gtkagg backend, i believe) even after i quit the python interpreter
(???).

i found this when trying to use matplotlib in a python session open
across a ssh -X connection . the ssh hangs upon disconnect, meaning
that x connections are still open.

i would like to use matplotlib interactively from a python app that
runs on a remote machine and be able to disconnect (using screen). the
issue mentioned above, however, ruins the reconnect, i get a "x server
connection broken" error when i try to use matplotlib after
reconnection. is there a way around this?

thanks,
ondrej marsalek