As described in the answer to the question (Delphi 2009) idIRC, MDI, and problems with hanging
, IRCPrivateMessage
runs in the same thread as the blocking socket. Accessing the GUI from this event handler without proper protection is not allowed.
You need to use Synchronize
, Queue
or other techniques like posting messages to the main thread.