Link Copied
Thanks for detailed explanation! it looks you use 2 mixed global new/delete operators, the one from mfc and another one from runtime. It is a luck that they workwith the same heap. But i'm pretty sure that it stops working if you'd like to use static runtime or mix debug and release configuration of different dlls. Unfortunately wedo not cover visual studio specific debug api and we replace new/delete pair in runtime only. This caused the problem. We will think more about what we can do here.
btw you can useone allocator for both cases, for example tbb::scalable_allocator:)
--Vladimir
For more complete information about compiler optimizations, see our Optimization Notice.