Jump to content
  • Advertisement

Archived

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

Valderman

Sharing memory with DLLs

This topic is 5577 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''ve spent hours debugging my program, and I''ve finally come to a simple conclusion: When memory is allocated in a DLL (loaded with LoadLibrary/GetProcAddress), it crashes when trying to release the memory. When memory is allocated in the same thread that releases it, it works fine. Doesn''t windows allow different modules to release each others memory, and will I have to have a function for releasing that memory in the DLL too?
For crying out loud, she has fishes coming out of her head on either side. How can you find this hot?!

Share this post


Link to post
Share on other sites
Advertisement
Use the DLL versions of the runtime libraries in your project settings. This will get rid of your memory allocation/deallocation problems.

Share this post


Link to post
Share on other sites
Hmmm... I''ve been looking for a setting like that, but I can''t seem to find it (I just switched to VC .NET)... Shouldn''t it be in General or perhaps Linker options?


For crying out loud, she has fishes coming out of her head on either side. How can you find this hot?!

Share this post


Link to post
Share on other sites
Project -> Properties -> Configuration Properties -> C/C++ -> Code Generation -> Runtime Library

Select Multithreaded DLL (or Multithreaded DLL Debug for a Debug build)

Share this post


Link to post
Share on other sites
Thanks a lot! (How could I miss that?)

EDIT: Damn! It STILL crashes!
EDIT again: This is damn weird! I wrote a memory deallocation function in the very same DLL, and it STILL crashes!

For crying out loud, she has fishes coming out of her head on either side. How can you find this hot?!

[edited by - Valderman on June 18, 2003 4:19:46 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!