分割类故障(11) [英] Class segmentation fault (11)
问题描述
请按照以下步骤操作:
- 创建新的
Firemonkey手机类应用程序
-
TGeustureManager
组件添加到窗体 -
添加2
TButton的
组件到表单
- Create New
Firemonkey Moblie Application
- Add
TGeustureManager
component to the Form Add 2
TButton
components to the Form
- Button1.Text:Button1的:做些什么......
- Button2.Text:将Button2:退出应用程序...
在Button2的组件双击并编写以下code为的OnClick
事件:
Double click on Button2 Component and write the following code for OnClick
Event:
procedure TForm1.Button2Click(Sender: TObject);
begin
if MessageDlg('Are you sure you want to Exit?', TMsgDlgType.mtWarning,
[TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], 0) = mrYes then
SharedActivity.finish;
end;
在设备上,单击该按钮2,然后单击是弹出的消息。例外会出现:
on the device, click the button 2, then click yes to the popped up message. An exception will appear:
这是为什么发生异常?
我认为这是关系到未使用 TGeustureManager
组件。但NO,是未
I thought it is related to unused TGeustureManager
component. but NO it is NOT:
- 如果您打开自带的德尔福xe5的
位置
演示项目。 - 添加如下图所示
TButton的
组件位置
标签:
- 如上面添加同一code到
的OnClick
事件。 - 运行应用程序,并单击Button5,你会得到相同的异常。
- If you open the
Location
Demo project that comes with Delphi xe5. - Add
TButton
component toLocation
Label as shown in the image below: - Add the same code as above to
OnClick
Event. - Run the application, and click on Button5, you will get the same exception.
这是一个错误,我应该举报?还是我做错了什么?
Is this a bug should I report? or am I doing something wrong?
推荐答案
也许你正在杀死运行,其前执行流已经耗尽,从而导致问题的活动。就像在形式方法释放一种形式....
Possibly that you are killing the activity that is running, before its execution flow has been exhausted, thereby causing problems. Much like freeing a form in a form method....
如果您更换会发生什么:
What happens if you replace:
SharedActivity.finish
与
uses
FMX.Helpers.Android;
...
CallOnUIThread(procedure begin SharedActivity.finish end);
[从内存类型,因此可能需要一些调整]
[ Typed from memory, so may need some tweaking ]
这篇关于分割类故障(11)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!