Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Finding Lost Handle

Finding Lost Handle

Scheduled Pinned Locked Moved C#
questiondata-structuresdebugginghelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    michaelbarb
    wrote on last edited by
    #1

    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.

    L 1 Reply Last reply
    0
    • M michaelbarb

      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.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups