条件时,终于在一个.NET try..finally块不执行条件、NET、finally、try

由网友(窦:情窦未开、窦你玩)分享简介:基本上,我听说某些情况下会导致.NET吹过去finally块。有谁知道那些条件?Basically I've heard that certain conditions will cause .net to blow past the finally block. Does anyone know what tho...

基本上,我听说某些情况下会导致.NET吹过去finally块。有谁知道那些条件?

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

推荐答案

两种可能性:

StackOverflowException ExecutionEngineException StackOverflowException ExecutionEngineException

当有finally块将不被执行 StackOverflowException ,因为没有空间在堆栈上,甚至执行更多的code。它还将时候有没有被称为 ExecutionEngineException ,可能出现通过调用 Environment.FailFast()

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().

阅读全文

相关推荐

最新文章