Finding Lost Handle
-
I was given a medium sized app, about 50,000 line total. It will not shut down on its own. You either have to kill it the debugger or go to Task Manager to kill it there. I have hit things like this before. You create a child and then kill the parent. You have lost the handle to the child and cannot close it. The app hangs when shutting down. Before I was building the program and knew when this happened. I only had to backtrack a little bit to find the problem. Now I have something written by someone else. When you kill the app even in the debugger you loose the stack panel. How can I find what the offender is?
So many years of programming I have forgotten more languages than I know.
-
I was given a medium sized app, about 50,000 line total. It will not shut down on its own. You either have to kill it the debugger or go to Task Manager to kill it there. I have hit things like this before. You create a child and then kill the parent. You have lost the handle to the child and cannot close it. The app hangs when shutting down. Before I was building the program and knew when this happened. I only had to backtrack a little bit to find the problem. Now I have something written by someone else. When you kill the app even in the debugger you loose the stack panel. How can I find what the offender is?
So many years of programming I have forgotten more languages than I know.
If it's a windows app (implying there is a windows collections), you see if there are are "hidden" windows hanging around (by querying the collection). If it's "looping" in managed code, it will show where if you "suspend" in Debug (not "cancel"). If it's hanging in "unmanaged" code, it gets more interesting.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food