Question about new/delete and dlls
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...
You are not supposed to do that. In general, delete in the same module that you allocate.
More details here
More details here
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement