The lines are properly added, per:
procedure TTCPClient.Execute;
var
Line: String;
begin
try
Socket.SSL.CertCAFile := FCertFile;
Socket.Connect(FHost, IntToStr(FPort));
Socket.SSLDoConnect;
if Socket.LastError <> 0 then
begin
if FOnError <> nil then
FOnError(Self, Socket.LastError, Socket.LastErrorDesc);
Exit;
end
else
begin
if FOnConnect <> nil then
FOnConnect(Self);
FConnected := True;
end;
repeat
while Socket.CanRead(1000) do
begin
Line := Socket.RecvString(1);
if Line = '' then
continue;
Window.LogClient(Line);
end;
until False;
finally
if FOnDisconnect <> nil then
FOnDisconnect(Self);
Socket.Free;
end;
end;
Where Window is a TConnectionWindow and LogClient appends to a TRichMemo's Text and sets some styling attributes. After some time the following happens:
(relgui:17611): Gtk-CRITICAL **: gtk_text_layout_real_invalidate: assertion 'layout->wrap_loop_count == 0' failed
(relgui:17611): Gtk-CRITICAL **: gtk_text_layout_real_invalidate: assertion 'layout->wrap_loop_count == 0' failed
(relgui:17611): Gtk-CRITICAL **: gtk_text_layout_real_invalidate: assertion 'layout->wrap_loop_count == 0' failed
(relgui:17611): Gtk-CRITICAL **: gtk_text_layout_real_invalidate: assertion 'layout->wrap_loop_count == 0' failed
**
Gdk:ERROR:/home/jmm/scratch/gtk/gtk+2.0-2.24.25/gdk/gdkregion-generic.c:1110:miUnionNonO: assertion failed: (y1 < y2)
Aborted
Is it necessary to use critical sections to access the GUI elements? There should be no contention issues. I am starting to feel I may need to restructure the project completely (e.g. message queues) due to limitations of GTK.