Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.
Please, use the code I sent you. I tested it and it works correctly.
As I comented before, "Application.ProcessMessages" is not recomended.
In fact, you will find many web pages that suggest the same thing for other kind of Delphi components. Application.ProcessMessages can only be used if you're really sure it won't cause problems with other components and this is one of the cases where its use is discouraged.
Additionally, some VCL functions were not designed with Chromium in mind. Sometimes they recreate handles when you don't expect it and this can also cause problems.
I have removed 2nd TChromium component and now program still not able to close. When I press X button, it hides main form and closes Chromium process, next I see
Access violation at address 006AEACA in module 'browser.exe'. Read of address 00000000.
OK
After pressing OK, program terminates. So everything is ok except this message.
Sub-process terminates correctly
Application hides main form
After hiding the form, application is in processes for about 12-13 seconds
After 13 seconds it shows error message with OK button
After pressing OK it terminates.
Я сомневаюсь в правильности построения функций по работе с хромиумом, может поэтому и ошибки сыпит, что не может прочитать адрес несуществующего объекта. Ты писал ранее у тебя 1000 функций, вот убедись, что перед завершением работы хромиума эти функции не пытаются обращаться к хромиуму никоим образом, когда ты нажимаешь кнопку закрыть, все функции должны прервать свою работу, затем ты посылаешь сигнал завершения хромиума и потом закрывается программа.