title: Throwing C++ exceptions across DLL boundaries
body: <p>I've read various things about how one should not allocate heap memory in one DLL and deallocate it from outside that DLL.  But what about throwing an exception object that is a just a temporary (as most exception objects are)?  E.g.:</p>
  
  <pre><code>throw my_exception( args ); // temporary: no heap allocation
  </code></pre>
  
  <p>When the exception object is caught outside the DLL, the destructor for that object will eventually be executed and the non-heap memory for the object will be reclaimed.  Is that OK since it's not heap memory?</p>