Jump to content

Memory Leaks after using debug unigne_x86d.dll


photo

Recommended Posts

We have one application which runs on DirectX 9 / 10 / 11 APIs. We separately build the unigine.dll through our project. When we use our version it gives memory leaks after our application terminates. Then we checked the things with unigine_x86d.dll supplied by SDK and even build from project suipplied by SDK. There were no memory leaks.

 

But apparently the Project Properties / C-C++ / Code Generation / Runtime Library is using /MD instead of /MTd. This is how leaks are hidden in the SDK supplied dll.

 

Do you have any insights about this problem? What should be done to manage these leaks? Even in SDK supplied project, LIBCMT.lib is ignored. How to fix this issues?

 

Regards,

Rohit Gonsalves.

Link to comment

Please, use SCons to compile unigine_x86d.dll.

 

Hello,

 

Anyhow Scons also uses visual studio environment. The important point here is that debug dll runtime is not selected for unigine_x86d.dll. When we select debug runtime the dll shows leaks. These leaks may be because of c run time linking.

 

Why you did not select the debug runtime for mutli threaded dll in debug configuration? That is the only question. Even without that and using dll from SDK we dont see any leaks in debug mode. This is not good solution to hide leaks by using non debug runtime in debug configuration. Then what is the point of debugging the dll.

 

Please advice.

Link to comment

All DLL's/debug code generation must match across everything that uses them.

There may be another referenced library or object or dll or some code in there that is built using the wrong options;

or specific options for an individual element that override the global project options, that is why SDK unigine_x86d.dll does have a correction functionality.

The reason why it doesn't work is probably because the debug version adds extra guard blocks around memory to allow detection of errors.

The Unigine engine has its own memory allocator, please, compile unigine_x86d.dll using SCons because we check all of the options for each file and for the included and referenced libraries.

 

P.S.

Unigine engine uses only native core libraries (for example, for windows 32bit like: KERNEL32.dll, USER32.dll, GDI32.dll), which is located in C:\Windows\System32, this dlls don't have PDB files (PDB Files relate only to debugging. They are the debug symbol files that allow you to step through/into your code using F5 or F8), so there is no debug file for Kernell32.dll or USER32.dll which is correct.

Microsoft rarely includes PDB files so you can not step through their code.

Link to comment
×
×
  • Create New...