BitmapHandle'未能正确释放带值的句柄

本文关键字:释放 句柄 BitmapHandle | 更新日期: 2023-09-27 18:08:18

在WPF应用程序中关闭SplashScreen时,我收到以下错误:

Message: A SafeHandle or CriticalHandle of type 'BitmapHandle' failed to properly release the handle with value 0xD0052B9B. This usually indicates that the handle was released incorrectly via another means (such as extracting the handle using DangerousGetHandle and closing it directly or building another SafeHandle around it.)
ReleaseHandleFailed was detected

BitmapHandle'未能正确释放带值的句柄

这个问题似乎是本页提到的框架上的一个bug。

http://connect.microsoft.com/VisualStudio/feedback/details/720719/releasehandlefailed-thrown-by-mda-when-using-the-splash-screen-feature-of-wpf

我在调试模式下收到这个异常,当在VS 2010中启用debug/exception "ALL"时。

为了摆脱这个异常,我不得不在VS 2010中重置为默认的Debug/Exception

我必须在Debug -> Exceptions中禁用Managed Debugging Assistants下的ReleaseHandleFailed Exception以摆脱编译器警告。