Question about new/delete and dlls

Started by
1 comment, last by BriTeg 18 years, 9 months ago
I recall reading something about this once, but I can't find it again. If I allocate some memory in the main .exe or a .dll with new, is it alright to release it in another .dll with delete? Or does memory have to be deleted in the same module it was allocated in? I tried deleting some allocated mem in a separate .dll, and it seemed to work fine, but something in the back of my brain is nagging at me...
Brianmiserere nostri Domine miserere nostri
Advertisement
You are not supposed to do that. In general, delete in the same module that you allocate.

More details here
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Cool, thanks. Yes, that difference in heap usage between statically linked .dlls and dynamically linked .dlls was the little warning my brain was trying to remember. Thanks! :)
Brianmiserere nostri Domine miserere nostri

This topic is closed to new replies.

Advertisement