Avatar of Stef Merlijn
Stef Merlijn
Flag for Netherlands

asked on 

Main thread of application stopped

Hi,

In my application I need to start several instances of the same form, each one with unique settings.
Multiple instances might be opened for a while. The main application must remain available to work in.
Sometimes when I push f.e. the save-button on one of these forms the application freezes and in the Delphi IDE I see "Main thread stopped : 1492" in the titlebar. After that the only way to recover from this is to shutdown Delphi via taskmanager and restart).
procedure TFMain.OpenMyForm(CONST ID : String; vMakeCopy : Boolean);
var MyForm : TForm;
begin
    MySettings := ID;
    MyForm := TFMyActualForm.Create(Application);
    MyForm.Show;
  end;
end;

Open in new window

Does anyone have any idea what might be a possible cause? Or maybe there is a better way to create instances of the for?
Delphi

Avatar of undefined
Last Comment
RBertora

8/22/2022 - Mon