title: When exactly would a DLL use a different heap than the executable?
body: <p>I know that if your DLL  static links against a different version of the runtime then it creates its own heap. It will also if it is instructed to make a heap. Under these circumstances, it is unsafe for the DLL to delete what the exe allocated. In what cases does this NOT apply (as in, it is safe for the DLL to delete what the exe allocated)? Is it safe if both the exe and the DLL static link against the same runtime library?</p>
  
  <p>Thanks</p>
  
  <p>basically is there a way where whoever allocates it could just do <code>addEvent(new DerivedEvent(), FunctorDestroyClass());</code> </p>