Hi, since peek is a kind of silly unthread safe function, maybe that functionality should be removed.
Anyone have any ideas about this? If not, I'll remove that functionality. Cheers, On 7/11/06, Alex Holkner <[EMAIL PROTECTED]> wrote:
Alex Holkner wrote: > An additional undocumented signature is available: > pygame.event.peek(): return Event > > The function returns the next event instead of a bool if no arguments > are given. > > The returned event is filled with nonsense (uninitialized) values if > no event is in the queue. Suggest it return None in this case > instead, or that the undocumented functionality be removed entirely. > > Alex. > > Having just looked at the pygame.event.post() code: it is possible to crash pygame (or at the very least, get garbage values) by posting a user event with a dictionary, then peeking that event more than once (or peeking it and then getting it). User event dictionaries are freed when requested, so if peek() with no arguments is desired, "user_event_getobject" needs to be modified to not free "userobj" when peeking, only when getting. Alex.
