[EMAIL PROTECTED] wrote: >Christian Reis writes: > > On Sat, Sep 07, 2002 at 01:39:50AM -0400, [EMAIL PROTECTED] wrote: > > > My pygtk application (mapview -- views terraserver maps) is crashing > > > xfree86. Presumably this is because I'm using up some resource, but I > > > don't know what it might be. I'm allocating pixmaps, but at least in > > > theory I'm also deleting the variable that holds them, when I remove > > > them from the cache. So their memory should be freed up, shouldn't > > > it? Or is there something else I have to do? Is there a way to ask > > > the X server what resource I'm using up? > > > > I assume we can't see the code to the application that causes the crash? > > Or is it a random crash? What are the conditions for it happening? > >http://russnelson.com/{mapview,mapview.glade} > >If I browse enough maps, it crashes. I would *guess* that mapview's >cache code isn't working properly, and isn't freeing up pixmaps. I >asked Jim Gettys, and he says that there is currently no way to find >out how many pixmaps an X server is storing. > > > Why are you assuming you are using up some resource? Very recently > > Mozilla had a couple of X server crashes related to scrolling and IIRC > > saveunders. > >Because I had tried many identical operations previous to the one that >caused the server to crash. > > > I would recommend ditching the GdkImlib module and using the gdkpixbuf one. GdkImlib implements its own image data and pixmap caches, and sometimes ends up working against the programmer. So, you want to create a GdkPixbuf from the image file (gdkpixbuf.new_from_file) in get_map(), and render it in map_draw() the pixbuf's render_to_drawable() method.
Rather than creating a server side pixbuf of the whole map, this will just maintain the client side RGB buffer, and render the required region on request (which is should be fast enough). You almost never want to use Imlib 1.x :) James. -- Email: [EMAIL PROTECTED] | Linux.conf.au http://linux.conf.au/ WWW: http://www.daa.com.au/~james/ | Jan 22-25 Perth, Western Australia. _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/