John, do you really think that somebody will seriously consider this to be a Lazarus issue if you demonstrate the problem with the attached enchat.unix project containing 75 files? And you don't even give instructions on how to get to the buggy situation.
If you really want somebody to take his time to fix this issue you should at least take your time to write a minimalized project containing only what's needed to reproduce the error.
My apologies wp. I've attached a small project.
When you click the delete button, it should change the tnotebook index page to 0 and delete the page 1.
I hope this helps.
I'm sorry I can't remove enchat.unix.zip
Actually I tried Notebook1.removecontrol(notebook1.page[1]) but I don't know exactly what it is for.
It worked, but I can't create the dynamically later.
I just tried Application.RemoveComponent() as you wrote but I got access violation too.
The issue is that Notebook.Pages.Delete(0) tries to set the parent of the page to be deleted to nil which in turn calls Notebook.Pages.Delete(0) again. This happens when deleting any page (at least on Windows).
The fix is applied in Lazarus trunk r53085, so in order to test you need to use trunk >= r53085.
The fix will be merged into 1.6 branch, so it will be in the upcoming 1.6.2 release.
(Fixes cannot be applied to released versions)