2
votes

I have a 3rd-party component that causes the Delphi IDE to stop responding (hang) when I try and close a project that has a form containing the problem component in it.

Is there an easy way to track where in the component's code the problem could lie?

Would it be reasonable to say that it is in the destructor of the component?

What steps would be recommended to try and narrow down the cause?

madExcept does not show anything so it does not seem to be an access violation problem.

Thanks for kind assistance.

1
Simple approch is to stuff some logging in to see where it blocksDavid Heffernan
Last time I had such a problem it was a finalization section in one of the runtime or designtime units. These run when the BPL is unloaded. Rob's answer is the only sane thingyou can do. Bisecting such a problem with log messages could take all day. Debugging could take 10 minutes. Use the Debugger.Warren P
Hi Warren P, I'm also wondering if it is in the finalization section of the registration of the component. In the finalization section, a callback hook object is freed and I'm wondering whether this is ever done. When does the finalization section of a component registration run? I have placed a ShowMessage statement in the finalization part and this message never appears. So, is the hook object ever getting freed?user1202134

1 Answers

2
votes

The same way you'd track down any other problem: Use the debugger.

Start Delphi and open a project. Set the project's "host application" to be Delphi itself. Run the project in the debugger, and another instance of Delphi should appear. In the new instance, reproduce the bug. When it hangs, go to the debugger (the first Delphi instance) and pause execution. Look at the call stack and find the bug.