title: Delphi app crashing outside debugger but not inside
body: <p>Our DUnit project is crashing on exit. It crashes if "Run Without Debugging", but <em>doesn't</em> crash if I Run <em>inside</em> the debugger.</p>
  
  <p>If I attach the debugger to the process after starting it, it does not crash on exit.</p>
  
  <p>I suspected a problem in finalization, so I put print statements in all the finalization code I suspected was running. This turned up nothing useful. Finalization for one of our low level Units (with no dependencies on any non-system Units) is running correctly. So it still <em>could</em> be finalization, but it may not be.</p>
  
  <p>The crash produces this dialog:</p>
  
  <pre><code>Problem signature:
    Problem Event Name:   APPCRASH
    Application Name: MCLTesting.exe
    Application Version:  0.0.0.0
    Application Timestamp:    4eb07b50
    Fault Module Name:    kernel32.dll
    Fault Module Version: 6.0.6001.18215
    Fault Module Timestamp:   49953395
    Exception Code:   c0000005
    Exception Offset: 000bf395
    OS Version:   6.0.6001.2.1.0.256.6
    Locale ID:    3081
    Additional Information 1: b37c
    Additional Information 2: 2a7328d8bb40c81c93b4b5f46adb8e10
    Additional Information 3: b37c
    Additional Information 4: 2a7328d8bb40c81c93b4b5f46adb8e10
  </code></pre>
  
  <p>"Exception Code: c0000005" Does that mean anything?</p>
  
  <p>The main clue I have is the fact that it doesn't crash in the debugger. Has anyone seen that before?</p>