Re: Should there be a way to query if an event queue is empty?

2013-07-27 Thread Neil Roberts
Bill Spitzak writes: > I think that rather than some trick to fool glib into making the poll > return immmediately, calling dispatch_pending in a loop until it returns > false will work better, and the poll can be called normally. I wouldn't consider this to be a ‘trick’. It's normal and docum

Re: Should there be a way to query if an event queue is empty?

2013-07-27 Thread Daniel Stone
On 27 July 2013 19:28, Bill Spitzak wrote: > I think that rather than some trick to fool glib into making the poll return > immmediately, calling dispatch_pending in a loop until it returns false will > work better, and the poll can be called normally. Um, it's not a trick, it's exactly how GSour

Re: Should there be a way to query if an event queue is empty?

2013-07-27 Thread Bill Spitzak
I think that rather than some trick to fool glib into making the poll return immmediately, calling dispatch_pending in a loop until it returns false will work better, and the poll can be called normally. If glib does not reliably call something before the poll (possibly documented as something

Re: [PATCH weston 04/11] compositor-fbdev: Avoid dereferencing a pointer in freed memory

2013-07-27 Thread Bill Spitzak
On 07/27/2013 02:08 AM, Rob Bradford wrote: On 27 July 2013 00:21, Bill Spitzak wrote: + device = output->device; fbdev_output_destroy(base); Are you sure this does not free the memory that is now at *device? Maybe I missed something - can you point me at the

Re: Should there be a way to query if an event queue is empty?

2013-07-27 Thread Neil Roberts
Bill Spitzak writes: > You can call dispatch_pending "last", ie as part of the dispatch > function. It's in a loop, so doing something at the end of the loop is > the same as doing it at the start. I don't think that will work for GLib because you can't really control the order of the dispatch f

Re: [PATCH weston 04/11] compositor-fbdev: Avoid dereferencing a pointer in freed memory

2013-07-27 Thread Rob Bradford
On 27 July 2013 00:21, Bill Spitzak wrote: >> + device = output->device; >> fbdev_output_destroy(base); > > > Are you sure this does not free the memory that is now at *device? Maybe I missed something - can you point me at the code which makes you think it does? My