title: Why does my multi-threaded app sometimes hang when it closes?
body: <p>I'm using several critical sections in my application. The critical sections prevent large data blobs from being modified and accessed simultaneously by different threads. </p>
  
  <p>AFAIK it's all working correctly except sometimes the application hangs when exiting. I'm wondering if this is related to my use of critical sections. </p>
  
  <p>Is there a correct way to free TCriticalSection objects in a destructor? </p>
  
  <p><i>Thanks for all the answers. I'm looking over my code again with this new information in mind. Cheers! </i></p>