[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] event getting corrupted



Lenard Lindstrom skrev:
Bo Jangeborg wrote:

well, there is code after mouse_pos = event_pos.
I would add a assert type(event) is not long
after any function call in mouse_button_up to know when event is changed,
then drill down the offending function.

--
claxo

I have only gotten one more trace, and that after several hours of testing. That time I got the same error but in another part of the code. I will try to find a pattern,
but I am not hopefull.

Bo)
Hi Bo,

The event object is probably not being overwritten. That would mean a reference count problem somewhere, most likely causing a segfault first. Is mouse_button_up a true method, declared in a class statement?

Lenard Lindstrom

mouse_button_up is a class method of my Gui class | class Gui(Widget): |. And it only gets called from
within its main_loop method.
I have had another trace where the event had turned into a long within that main loop. In that case there also was other readings from the event object that worked before getting to the part where it crashed, without interceding
assignment to the event variable.

So it seems like it could happen at different places without the event being assigned to, which makes me think that the problem doesn't happen in my code. I does seem to be related to user input because it only happens when
I have released the mouse button as far as I can remember.

I noticed that there was talk about switching the fastevent module to be the default, has that been done ?

Bo)