One of two destructors is not called during stack unwind
<p>I have an application written on MS Visual C++ 2005. It had failed on client's computer. I cannot reproduce the fail; all I have for analysis is log created by the application. In the application I have the following fragment:</p>

<pre><code>class EntranceLoggerForFunc
{
public:
EntranceLoggerForFunc()
{
    WriteToLog("EntranceLoggerForFunc");
}
~EntranceLoggerForFunc()
{
    WriteToLog("~EntranceLoggerForFunc");
}
}

void Func()
{
    EntranceLoggerForFunc logger;
    ....
    if (&lt;some comdition&gt;)
        Func();
    ....
}

void Func2()
{
    try
    {
        Func();
    }
    catch(...)
    {
        WriteToLog("Exception happened");
    }
}
</code></pre>

<p>The application is compiled with key /EHa (Enable C++ exceptions with SEH Exceptions'. </p>

<p>In the log I see the following:</p>

<p>EntranceLoggerForFunc
EntranceLoggerForFunc
~EntranceLoggerForFunc
Exception happened</p>

<p>In other words, an exception happened somewhere inside the Func(); and had been caught in Func2(). But why ONLY ONE destructor of the two objects EntranceLoggerForFunc has been called during stack unwind?</p>

<p>Now I have only the following version: stack was somehow damaged (most probably by the same wrong operation that led to the exception), and this is why one of the destructors did not work.</p>

<p>Any other versions?</p>
