Jump to content
Ian Branch

Possible D10.4.2 issue..

Recommended Posts

11 minutes ago, Lajos Juhász said:

Sometimes it can result an Access Violation, it will cause no problem if in the meanwhile the handle is not used otherwise you cannot predict the result.

Prove it.

Share this post


Link to post
48 minutes ago, balabuev said:

the subsequent CM_RELEASE message is ignored

Who by?

 

21 minutes ago, balabuev said:

Prove it.

It's a race condition, nothing to prove.

 

 

Not to mention that those implementations could change.

Edited by Attila Kovacs

Share this post


Link to post
3 minutes ago, Attila Kovacs said:

Who by?

By Windows I guess. If some window becomes destroyed, all its pending messages are removed from the queue.

 

5 minutes ago, Attila Kovacs said:

It's a race condition

No. Unless you explicitly call Application.ProcessMessages [potentially] in a loop.

 

 

Share this post


Link to post
35 minutes ago, balabuev said:

Prove it.

It's enough to insert anything between ShowModal and Free that will call an Application.ProcessMessages, for example to show another modal form and oops you get: 

Project Project1.exe raised exception class EInvalidPointer with message 'Invalid pointer operation'.

Something like:
 

procedure TForm1.Button1Click(Sender: TObject);
var x: TForm2;
    x2: TForm;
begin
  x:=TForm2.Create(nil);
  x2:=nil;
  try
    x2:=Tform2.Create(nil);
    if x.ShowModal=mrOk then
      x2.showmodal;
  finally
    x.free;
    x2.free;
  end;
end;


 

Share this post


Link to post
2 minutes ago, Lajos Juhász said:

It's enough to insert anything between ShowModal and Free that will call an Application.ProcessMessages

 

Yes. You right. But the original code was:

with TLogInForm.Create(nil) do
try
  Result := ShowModal = mrOk;
finally
  Free;
end;

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

×