DelphiFMX4Python icon indicating copy to clipboard operation
DelphiFMX4Python copied to clipboard

Python is freezing on exit

Open zwm88 opened this issue 2 years ago • 5 comments

On Windows 10, run the Todo.py and click the 'X' button, the window will be closed but the python won't exit. Taskman shows "no response".

image

From the debug window, I can see python is dead in the directx/graphics driver. image image

I found a workaround. I can add a string to the Edit.Text, even a '' will work. An empty string '' won't work. image

But if I add a Calendar to the form, it freezes again on exit.

My other Windows PC (same Python, different gfx card) has no such issue. I'm currently using Python 3.9.12 installed from Microsoft Store.

By the way, seems that TNumberBox, TComboTrackBar, etc. are not supported.

zwm88 avatar Mar 31 '22 05:03 zwm88

I couldn't simulate this issue on my devices, but I will try to figure out something.

lmbelo avatar Mar 31 '22 20:03 lmbelo

Not fixed in the latest release.

zwm88 avatar Jun 22 '22 16:06 zwm88

@zwm88, I still can't reproduce this issue.

Can you attach your sample script?

lmbelo avatar Jun 29 '22 12:06 lmbelo

This is the script I used: DelphiFMX4Python\samples\ToDoList.py And the Edit has no cursor when focused. I also tried this script: DelphiFMX4Python\samples\ControlsDesktop\controlsdemo.py It has the cursor, and the exit looks OK. But if I use back key to delete the "some text" in the Edit box, it will hang again after exit.

Conclusion: empty text box will cause the hanging on exit.

zwm88 avatar Jul 10 '22 08:07 zwm88

Another finding: If I add these two lines after "print('Exiting...')":

    Application.Destroy()
    dir(Application)

The script can exit.
What "dir(Application)" does to pull the application out of freezing?

zwm88 avatar Aug 25 '22 18:08 zwm88