- This topic has 6 replies, 2 voices, and was last updated 3 years, 9 months ago by
TomYU.
-
AuthorPosts
-
-
April 4, 2022 at 01:24 #56381
TomYU
Participanthi,
create a blank fmx project, put a kbmMWClientConnectionPool1 on form, run on android.
app not close.
code:
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
kbmMWCustomConnectionPool, kbmMWClientDataset, FMX.Controls.Presentation,
FMX.StdCtrls;type
TForm1 = class(TForm)
kbmMWClientConnectionPool1: TkbmMWClientConnectionPool;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
{$R *.fmx}
procedure TForm1.Button1Click(Sender: TObject);
begin
kbmMWClientConnectionPool1.Free;
end;end.
-
This topic was modified 3 years, 9 months ago by
TomYU.
-
This topic was modified 3 years, 9 months ago by
-
April 6, 2022 at 12:44 #56401
kimbomadsen
KeymasterHi,
I would not expect a component owned by the form to be manually freed. What happens if you instantiate it without ownership and then free it?
/Kim
-
April 10, 2022 at 01:31 #56411
TomYU
Participanthi,
I did this just to redisplay the problem.
When the application is closed, because this component cannot be released normally, the application cannot exit normally. When the application is restarted, the application is stuck.
This is a problem on the Android platform.best regards
Tom YU.
-
April 12, 2022 at 12:56 #56413
TomYU
ParticipantWhen the application is closed, kbmMWClientConnectionPool1 will be released.
and kbmMWClientConnectionPool1 will execute the following methods:
FRefreshScheduler. StopScheduling;
On the Android platform, this line of code is frozen and will not continue.So the application can’t exit normally!
fixed code:
procedure TkbmMWPooledDatasetRefreshScheduler.StopScheduling;
begin
if FThread.IsStarted then//add by Tom YU
FThread.Pause;
end;I don’t know if this correction is correct, but my application can be closed normally.
best regards
Tom YU.
-
April 13, 2022 at 00:28 #56414
TomYU
ParticipantAs a new development, I found that the code implemented in this way can execute normally on android platform.
procedure TForm1.Button2Click(Sender: TObject);
begin
rs:=TkbmMWPooledDatasetRefreshScheduler.Create(Self);
rs.StopScheduling; //not frozen when TkbmMWPooledDatasetRefreshScheduler.Owner<>nil.
rs.Free;
rs:=nil;
end;
-
April 13, 2022 at 00:49 #56415
TomYU
ParticipantThe pause method does not work as expected on the Android platform:
procedure TkbmMWCustomThread.Pause;
-
April 13, 2022 at 01:11 #56416
TomYU
ParticipantDefault compilation variables used:
{$DEFINE KBMMW_SUPPORT_FASTMRWSLOCK} // If to use native very fast Multiple Reader Exclusive Writer lock.
-
-
AuthorPosts
- You must be logged in to reply to this topic.
