balabuev 102 Posted March 3, 2021 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
Dalija Prasnikar 1396 Posted March 3, 2021 On 3/2/2021 at 4:27 AM, Ian Branch said: Unless someone can enlighten me otherwise, I suspect an issue here.. This sounds awfully familiar with this issue https://quality.embarcadero.com/browse/RSP-33140 But this issue shows when VCL Styles are used. Maybe something else got broken... Share this post Link to post
Attila Kovacs 629 Posted March 3, 2021 (edited) 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 March 3, 2021 by Attila Kovacs Share this post Link to post
balabuev 102 Posted March 3, 2021 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
Lajos Juhász 293 Posted March 3, 2021 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
balabuev 102 Posted March 3, 2021 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