As per the subject, occasionally (but not always) I get a SIGSEV in TScreen.FindNonDesignerDataModule (in includes/screen.in)
function TScreen.FindNonDesignerDataModule(const DataModuleName: string
): TDataModule;
var
i: Integer;
begin
for i:=0 to FDataModuleList.Count-1 do
begin
Result:=TDataModule(FDataModuleList[i]);
if (not (csDesigning in Result.ComponentState)) <<<<<<<<<<< here
and (CompareText(Result.Name, DataModuleName) = 0) then
Exit;
end;
Result := nil;
end;It happens when I create a form that's not in the auto create forms. For the time being, I set Application.FindGlobalComponentEnabled to false before creating the form
Application.FindGlobalComponentEnabled:=false;
LocForm:=TFormWtss.Create(nil);
Application.FindGlobalComponentEnabled:=true;
;
try
LocForm.ShowModal;
finally
LocForm.Free;
end;but what could be causing it?
I have several datamodules used by threads, so I thought that maybe the function is non thread safe, but the creation of said datamodules is done in the main thread.
