Unresponsive Main Window After Closing Child

Clarion 11.1.0.13855
ABC

I have an SDI/Generic “Main” Window where I call another SDI Window like:

If Not Glo:SomeThreadNumber
	Glo:SomeThreadNumber = START(MyChildWindow,,Param1,Param2)
End

In the MyChildWindow’s ThisWindow.Kill method I set Glo:SomeThreadNumber to 0.

Issue:

After closing the child window, when I attempt to close the main window, the main window becomes “unresponsive” and I have to kill it with the Task Manager.

I have checked, rechecked, and triple checked that I do not have some infinite LOOP going on (At least in my code.)

Does anyone have any suggestions or experience with something like this?

Thank you!

What is the CPU Usage? Is it high?
You can compile in debug and then use the debugger to attached to the running process and view the Thread list and break into the running thread to see where it is in the code.

The check if Glo:SomeThreadNumber is non-zero before starting the new thread doesn’t make sense to me. What sets Glo:SomeThreadNumber in the first place so it is non-zero?

You’re thinking what I was thinking.

Some mysterious infinite Loop somewhere would likely cause an increase in CPU usage.

However, CPU usage is actually Zero. Very weird.

START is setting Glo:SomeThreadNumber.

But you’re checking if it isn’t zero before you call Start.

I had a typo in my original post.

This:

If Glo:SomeThreadNumber
    Glo:SomeThreadNumber = START(MyChildWindow,,Param1,Param2)
End

Should’ve been:

If Not Glo:SomeThreadNumber
    Glo:SomeThreadNumber = START(MyChildWindow,,Param1,Param2)
End
1 Like

Is the child window actually closed and the procedure ended?
Having a rogue thread somewhere will cause that sort of behaviour.

Update.

So I eliminated the symptom although I am not sure what exactly caused it.

After traveling down the rabbit hole I found that I was calling a procedure in another DLL (This is a multi-dll app.). The called procedure simply returns a string after a few calculations.

Assuming the code in the called procedure is valid, I am not sure why calling a procedure in a different thread, in another DLL, would cause a problem.

Anyway, for now everything is good to go.

Thank you to everyone provided help on this!

You wouldn’t happen to have cyclic references between dlls would you?
While they don’t usually cause problems they certainly can, and some of the problems are just weird.