• Advertisement

Archived

This topic is now archived and is closed to further replies.

dll asserts

This topic is 6520 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a main program that interfaces with several dlls. Sometimes the main program asks for things from the dlls, and then the dlls dynamically allocate them and give them to the main program. When the main program is done, it tries to deletes all the dynamically allocated memory in its list. Whenever it deletes thing that a dll allocated there is an error and the program crashes. How do I work around this memory allocation problem?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
It is possibly for a DLL to use a seperate heap than its exe module. In this case calling new in the DLL and delete in the exe will not work. If these are your DLL''s you could write a function in the DLL that deletes the memory. If these are thrid party DLL''s, then off hand I don''t know of a solution - I don''t remember what causes a DLL to use a seperate heap - something to do with how you link with the RTL?

Share this post


Link to post
Share on other sites
I know I can make functions in the dll to delete things, but that would complicate things too much.

Share this post


Link to post
Share on other sites
You are probably using VC++ 4.0 (or something around 4), which causes a problem when the objects have virtual functions (and virtual destructors). It is a known bug in VC. If that is the case, you will have to upgrade.



- null_pointer
Sabre Multimedia

Share this post


Link to post
Share on other sites

  • Advertisement