Recent

Author Topic: ModalResult let Application Close/Crash  (Read 1827 times)

dietmar

  • Full Member
  • ***
  • Posts: 154
ModalResult let Application Close/Crash
« on: August 01, 2021, 02:32:07 pm »
Hello,

I have a button on the main form which opens a bsdialog modal form:
frmTest.ShowModal;

If the ModalResult of the OK-Button on the modal form is mrNone, nothing happens (as expected). As soon as I set that to mrOk, the form closes (what is ok), but then the application immediately terminates without any error.

I tried to debug with F7/F8, which led to strange assembler tracings and finally let Lazarus crashes completely!

Any ideas what's going wrong here?

Thx
--Dietmar
Lazarus 2.2.0RC1 with FPC 3.2.2 (32 Bit) on Windows10 (64Bit)

jamie

  • Hero Member
  • *****
  • Posts: 4848
Re: ModalResult let Application Close/Crash
« Reply #1 on: August 01, 2021, 02:44:11 pm »
Sounds like you have an uncreated form.

is this form created before using the ShowModal ?

Please show a very short simple example.
The only true wisdom is knowing you know nothing

dietmar

  • Full Member
  • ***
  • Posts: 154
Re: ModalResult let Application Close/Crash
« Reply #2 on: August 01, 2021, 09:07:14 pm »
You are right - I forgot to create it first.

Sorry for bothering...

--Dietmar
Lazarus 2.2.0RC1 with FPC 3.2.2 (32 Bit) on Windows10 (64Bit)

 

TinyPortal © 2005-2018