条件终于不执行在.net try..finally块 [英] Conditions when finally does not execute in a .net try..finally block

查看:123
本文介绍了条件终于不执行在.net try..finally块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我听说某些条件会导致.net吹过最后的块。有没有人知道这些条件是什么?

解决方案

两种可能性:





当有一个 StackOverflowException 时,finally块将不会执行,因为堆栈上没有空格甚至执行任何更多的代码。当有一个 ExecutionEngineException 时,它也不会被调用,这可能是从调用 Environment.FailFast()而产生的。


Basically I've heard that certain conditions will cause .net to blow past the finally block. Does anyone know what those conditions are?

解决方案

Two possibilities:

The finally block will not be executed when there's a StackOverflowException since there's no room on the stack to even execute any more code. It will also not be called when there's an ExecutionEngineException, which may arise from a call to Environment.FailFast().

这篇关于条件终于不执行在.net try..finally块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆