Neuer Versuch altes problem:
Delphi-Quellcode:
TTestClientSock = Class(TThread)
private
fSocket : TIdTCPClient;
protected
procedure Execute; override;
public
Constructor Create;
Destructor Destroy; override;
End;
.....................
constructor TTestClientSock.Create;
begin
inherited Create(true);
FSocket := TIdTCPClient.Create(nil);
end;
destructor TTestClientSock.Destroy;
begin
FSocket.Free;
inherited;
end;
procedure TTestClientSock.Execute;
var i,j : Integer;
begin
for i:= 0 to 5000000 do J:= i
end;
.....
uses ....
{$IFDEF ANDROID}
Androidapi.NativeActivity,
Posix.Pthread, FMX.Platform,
{$ENDIF}
.....
{$IFDEF ANDROID}
procedure MyEndThreadProc(ExitCode: integer);
var
PActivity: PANativeActivity;
begin
PActivity := PANativeActivity(System.DelphiActivity);
PActivity^.vm^.DetachCurrentThread(PActivity^.vm);
pthread_exit(ExitCode);
end;
{$ENDIF}
procedure THeaderFooterForm.FormCreate(Sender: TObject);
var
AppEventSvc: IFMXApplicationEventService;
begin
{$IFDEF ANDROID}
EndThreadProc := MyEndThreadProc;
{$ENDIF}
fSocket := TTestClientSock.Create;
fSocket.Start;
end;
wenn ich den socket weglasse geht alles ohne probleme sobald ich den socket ins Spiel bringe bekomm ich wieder
"Segmentation fault (11)"
unter Win Gestestet da funktioniert es...