[Lazarus] Lazarus application crash. Is PostMessage thread safe?

Giuliano Colla giuliano.colla at fastwebnet.it
Wed Feb 10 21:13:56 CET 2016


Il 10/02/2016 13:48, zeljko ha scritto:
>> I believe
>> that Application.ProcessMessages should protect itself too, avoiding to
>> handle more than once the same message.
>
> But where ? In LCL or per widgetset ? 

I skimmed through the backtrace. It would appear that the recursion 
originates in g_main_context_iteration() which calls 
g_main_context_dispatch(), which will continue to dispatch the same 
message. I don't believe that there's an easy way to protect 
Application.ProcessMessages from recursion unless someone is willing to 
debug and patch Glib (which is used not only by Qt, but also from GTK, 
if I'm not wrong). Personally I  give up.

Giuliano





More information about the Lazarus mailing list