开发者

WPF app closes itself after a while sometimes

开发者 https://www.devze.com 2023-03-05 10:00 出处:网络
The app is using my library which works using threads to do some operation; also it uses SIP VOIP library (obviously it is using threads). GUI is bound to interfaces of both libraries.

The app is using my library which works using threads to do some operation; also it uses SIP VOIP library (obviously it is using threads). GUI is bound to interfaces of both libraries. I noticed a weird behavior of my app. Usually it works just fine but sometimes after some time (3-5 minutes) it suddenly cl开发者_如何学Gooses.

It is too irregular to debug it or diagnose.

Anyone had that kind of problem? Any idea what could be the reason for that?


I would recommend you add an application level error handler so that you can log any errors that are occuring that you might be missing. It is as simple as

Application.Current.DispatcherUnhandledException += HandleApplicationException;

Here is an MSDN article that describes it: http://msdn.microsoft.com/en-us/library/system.windows.application.dispatcherunhandledexception.aspx

0

精彩评论

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