Crash on OSX because of postponed double click processing
Original Reporter info from Mantis: maaartinus
-
Reporter name: Maaartin
Original Reporter info from Mantis: maaartinus
- Reporter name: Maaartin
Description:
Closing a custom component on a double click can crash the application in CarbonWindow_MouseProc, because of the following:
- CallNextEventHandler calls our handler which hides an ancestor of the component.
- This frees the corresponding widget.
- The event processing in CarbonWindow_MouseProc goes on and accesses the Widget.LCLObject in the now freed memory.
Additional information:
I posted this first on http://comments.gmane.org/gmane.comp.ide.lazarus.general/82195 as I supposed a problem in our application. However, I could find no fix, so I guess, it's bug.
As a workaround, I compare Widget.LCLObject before and after calling CallNextEventHandler and exit on mismatch. Working but very hacky.
Mantis conversion info:
- Mantis ID: 28494
- OS Build: 14.3.0
- Platform: OSX
- Version: 1.4