Posted by seb64
on February 18, 2009 at 9:48 AM PST
I found a bug in the postMouseButtonEvent method in QtToolkit.cc (PhoneME Advenced Personal Profile b103 with qt for the native peers):
When a component is clicked, its peer is recorded in the static variable lastMousePressPeer, so that it can be notified if the mouse is released on another component.
The problem is that if the component is destroyed in beetwen (which is the case in my application), the lastMousePressPeer may now refer a destroyed peer which then leads to a segmentation fault.
I have made a quick patch that checks for the peer destruction by listening for its destroyed signal and seems to solve the problem but i'm afraid it lacks any kind of synchronization and could fail to work in some cases.
Is there a cleaner/more robust way to do this ?