Recent

Author Topic: Bug: setting ModalResult of a form closes the entire app  (Read 2537 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2488
    • UVviewsoft
Bug: setting ModalResult of a form closes the entire app
« on: March 15, 2022, 05:57:26 pm »
Maybe someone can find the time to reproduce it and debug?
As I see - setting ModalResult of a helper form, to any value (e.g. mrYes) - quits the entire app!
Only on gtk2 (works OK on qt5 / win32).

https://github.com/Alexey-T/CudaText/issues/3990

I tried to make a simple repro demo, but no repro! So to repro this, you need to compile CudaText project on gtk2.
What happens: setting ModalResult to form fmConfirmReplace (in OnKeyDown handler which handles 'y' key; or by pressing the Yes button) closes the entire app!
« Last Edit: March 15, 2022, 06:50:00 pm by AlexTP »

AlexTP

  • Hero Member
  • *****
  • Posts: 2488
    • UVviewsoft
Re: Bug: setting ModalResult of a form closes the entire app
« Reply #1 on: March 15, 2022, 06:06:10 pm »
Details:
- Linux Ubuntu 20 x64
- Lazarus: HEAD detached at 23b2324f9f (just before Qt5Pas new fix)
- Free Pascal Compiler version 3.2.3-587-g65733801e5-dirty [2022/02/13] for x86_64
- optimization=0 for the main project

How to compile the project:
https://wiki.freepascal.org/CudaText#How_to_compile_CudaText
« Last Edit: March 15, 2022, 06:17:22 pm by AlexTP »

Thaddy

  • Hero Member
  • *****
  • Posts: 16197
  • Censorship about opinions does not belong here.
Re: Bug: setting ModalResult of a form closes the entire app
« Reply #2 on: March 15, 2022, 08:18:39 pm »
Check the ownership? This only happens when the main form, or probably even the application, is the owner.
This is only a debugging hint.
If I smell bad code it usually is bad code and that includes my own code.

AlexTP

  • Hero Member
  • *****
  • Posts: 2488
    • UVviewsoft
Re: Bug: setting ModalResult of a form closes the entire app
« Reply #3 on: March 16, 2022, 09:18:36 am »
Thanks - I tried to change owner of that form
a) in the CudaText (to nil);
b) in the repro-demo (to the main form);
but it did not help with 2 cases.

 

TinyPortal © 2005-2018