Re: [pygtk] Problem with the GC starting in the middle of _wrap_gtk_window_list_toplevels

2009-03-08 Thread Tim Evans
Laszlo Pandy wrote: > Is the gtk.gdk.lock unnecessary? My understanding is that if you use > timeout_add the callback will happen as an event in the mainloop. ie. > it won't happen spontaneously in the middle of some other code unless > gtk.main_iteration() is explicitly called. > > So wouldn't ca

Re: [pygtk] Problem with the GC starting in the middle of _wrap_gtk_window_list_toplevels

2009-03-08 Thread Laszlo Pandy
Is the gtk.gdk.lock unnecessary? My understanding is that if you use timeout_add the callback will happen as an event in the mainloop. ie. it won't happen spontaneously in the middle of some other code unless gtk.main_iteration() is explicitly called. So wouldn't calling gc.collect() from the call

Re: [pygtk] Problem with the GC starting in the middle of _wrap_gtk_window_list_toplevels

2009-03-08 Thread Tim Evans
Margarita Manterola wrote: > Hi! > > I've already submitted a bug, with the whole information about this, > but I'm writting also to the list to see if someone has any idea of > how to fix it. > > This is a problem with the C wrapper of gtk_window_list_toplevels for PyGTK. > > This is the report

Re: [pygtk] Problem with the GC starting in the middle of _wrap_gtk_window_list_toplevels

2009-03-06 Thread Hrvoje Niksic
Margarita Manterola wrote: > I probably screwd up, because it didn't work. This is what I was left with: My code was not meant to be run verbatim, sorry I didn't make that clearer. For example, PyImport_Import takes a PyObject * argument, not a C string, use PyImport_ImportModule instead. Thi

Re: [pygtk] Problem with the GC starting in the middle of _wrap_gtk_window_list_toplevels

2009-03-05 Thread Margarita Manterola
On Thu, Mar 5, 2009 at 12:38 PM, Hrvoje Niksic wrote: > I'm not sure about a correct fix, but it's a bit worrying that the C > backtrace is showing no signs of GC.  Why not add code that disables the GC > and reenables it around the loop?  Something like: > > // error checking elided for brevity

Re: [pygtk] Problem with the GC starting in the middle of _wrap_gtk_window_list_toplevels

2009-03-05 Thread Hrvoje Niksic
Margarita Manterola wrote: > The garbage collector is called while the code is in the for loop, it > removes one of the toplevel windows which is not in use anywhere, > except that it's already on the list, thus after the GC returns and > the loop tries to access that removed window, it triggers a

[pygtk] Problem with the GC starting in the middle of _wrap_gtk_window_list_toplevels

2009-03-05 Thread Margarita Manterola
Hi! I've already submitted a bug, with the whole information about this, but I'm writting also to the list to see if someone has any idea of how to fix it. This is a problem with the C wrapper of gtk_window_list_toplevels for PyGTK. This is the reported bug: http://bugzilla.gnome.org/show_bug.cg