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?
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?
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.
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.