开发者

C#.NET : A graphical control makes my app freeze after workstation unlock

I have a graphical control that is multithreaded.

Until now it worked fine, but I just noticed that whe开发者_开发问答never I'm on my application showing this control the following happens: if I lock and unlock my workstation, it freezes, like if it were in some kind of infinite loop.

Even stranger, this bug occurs only when I'm not launching the app from Visual Studio, and not attached to it.

Does anyone have a clue on what's happening?

For instance, if I attach Visual Studio to the already freezed app, can I see which lines of code my threads are executing?

Any help will be appreciated!


We recently had (for about a year and a half ;) this same problem. It also triggers sometimes when IE flushes caches, when you change colors of you theme. etc.

The problem was that we had a splash screen that had its window created on one thread and then it was shown (ShowDialog()) within other thread. Once we moved the window creation to the same thread that actually shows it, it resumed. There was also some changes with .Dispose():ng the splash window, and they could also have had an effect.

Microsoft has an article about this and they basically suggest to run their Spy++ program and look at your program when it's hung. There is a "Windows" -window, search for your application and look for any windows that should not be there. They possibly have a windows message pump active/attached but it is not pumping. The "change" message does not get handled and all .NET windows stall -> hang.


just attach VS to the frozen app and hit Pause button, VS will show executing code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜