title: TThread Access Violating on Terminate/Free
body: <p>I am running a short bit of code that will occasionally (very rarely) Access Violate on the Terminate/Free of my TThread.  I am running many instances of these threads but this spot seems to be the only ones that is causing problems and it only does so once every 500 or so calls.</p>
  
  <pre><code>TThreadInheritor* Base= new TThreadInheritor(1);
    try {
      Base-&gt;Start();
      WaitForSingleObject((HANDLE)Base-&gt;Handle, 1000);
      MyBaseId = Base-&gt;scanvalue;
    }__finally {
      Base-&gt;Terminate();
      Base-&gt;Free();
    }
  </code></pre>
  
  <p>It is being thrown in my finally.  My first guess was that WaitForSingleObject was timing out in a weird way and causing the Terminate and Free to mess up, but I'm not quite sure how that would happen.  I didn't change anything to do with the Terminate/Free methods when I inherited from TThread.</p>
  
  <p>Anyone know what could cause those two methods to access violate after so little code?</p>