Memory problems

Started by
1 comment, last by CTar 18 years, 5 months ago
Quite a while ago I created a thread because my library was throwing an exception, it threw the exception because I had a STL container which for some reason got created in one DLL and destroyed in another DLL, never really figured out the cause, but two things solved the problem: 1) Changing the runtime (MSVC) to Multithreaded DLL. 2) Making an STL allocator calling Win32 functions instead of std::allocator. Now I'm starting to have some problems with my approach, first if I use my Win32Allocator I can't also supply a specialised allocator. I might be able to do some template stuff to make it possible to specify another allocator, but my biggest problem is one I just discovered. When using other libraries this exception gets thrown aswell (for example in the Loki singleton), I don't know what to do I could edit the Loki source, but that would be a very bad approach for two reasons: 1) This is probably not allowed in the license (I use more than one library so there is a good chance at least one forbid me to change the source). 2) Users would have to replace their Loki (or whatever library I change) implementation with mine. I don't want to force the user to use a specific runtime, but it might be necessary if I find no other alternatives. So have anyone overcome this problem? If so, how?
Advertisement
Did you create the DLL files yourself or are they the loki stuff?
If you have created them, maybe you can use a container other than a STL one, like creating your own and modifying it to work within their DLL scopes. I hope this will help.
"Take delight in the Lord and He will give you your heart's desires" - Psalm 37:4My Blog
Quote:Original post by Last Attacker
Did you create the DLL files yourself or are they the loki stuff?
If you have created them, maybe you can use a container other than a STL one, like creating your own and modifying it to work within their DLL scopes. I hope this will help.


If yoy by DLL files mean the files using the Loki library (my game engine), then yes I created them myself. If you mean the Loki DLL then I'm using the static library, but I could re-compile, the problem is that if I change Loki code then I would need all my users to get my custom-Loki code and this is a general problem so it also happens with other libraries, which means that I can't do it since some licenses say I can't edit the source code. Also I don't want to use other containers than the STL ones.

I'm beginning to wonder if I should just change the runtime, what is the difference between the multithreaded runtime and the multithreaded dll runtime?

This topic is closed to new replies.

Advertisement