Exception in destructor
<p>In my destructor, I have to clean up a few resources. Let say I have three calls to clear resources that could throw. Since it is not good for letting an exception to leave a destructor, what should be my design pattern? Apparently the way below is not scalable.</p>

<p>Thanks.</p>

<pre><code>class B::~B(){

try{
   clearResourceA()
 }
 catch{
     try{
         clearResourceB();
        } 
     catch{
         clearResourceC();
     }
     clearResourceC();
 }
clearResourceB();
    .
    .
}
</code></pre>
