Do you also get a SIGSEGV with
begin
PageControl1.Pages[0].Free;
end;
?
Yes, this crash too (only in GTK2 while in Qt4 it works too).
I tried to move the code from PageControlMouseUp to TabSheetMouseUp and it works (i.e. GTK2 is able to delete the last page w/o crash).
I guess you need it because of some user-friendly GUI, right?
Try this:
if (PageControl1.PageCount>1) or not (Sender is TPageControl) then
PageControl1.Pages[0].Free;
as a general mouse up event, where user will have to close the last tab by click on the tab (not the header).
You can open a issue, of course.
...
I did one more test and it works for PageControlMouseDown.