Jump to content
Ruslan

Error in LAction.Target := nil

Recommended Posts

I use TFrameStand (using Wizard demo), on a frame there are buttons with actions, on destroying the frame a AV error shows up from FMX.Controls TControl.CLick (line 4314)

if LAction <> nil then
  LAction.Target := nil;

LAction is not nil but all its members are.

Is it a bug or am I doing something wrong?

Edited by Ruslan

Share this post


Link to post
3 minutes ago, Ruslan said:

I use TFrameStand, on a frame there are buttons with actions, on destroying the frame a AV error shows up from FMX.Controls TControl.CLick (line 4314)


if LAction <> nil then
  LAction.Target := nil;

LAction is not nil but all its members are.

Is it a bug or am I doing something wrong?

Solved that by adding folowing code into buttons' actions

TDelayedAction.Execute(50
, procedure
	begin
		// action code
	end
);

 

Share this post


Link to post

Hi @Ruslan, if you are freeing (closing) the frame (frameinfo) within an event handler of an UI element you may need to wait some amount of time in order to let the UI finish its activities related to the event itself (i.e. if it's a button, there might be some animations going on and/or similar things).

 

Sincerely,

Andrea

  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×