Managed VC++ crashing in debug build caused memory leaks

P

PL

Hi everyone,
I was surprised to see memory leaks in our application when it crashed
today. Basically, the code is written in C#, but with c# and C++ DLLS;
its the latter (managed extensions) that cause the memory leaks (the new
operator in crtdbg.h). Does the garbage collector not work in debug build
for VC++?

TIA

Paul
 
B

Ben Voigt

PL said:
By the way, this is using .NET framework 1.1 - we can't upgrade to 2 yet!

Remember that only __gc objects are garbage collected, and the new operator
can also allocate from the native heap. This is distinguished a lot better
in C++/CLI, but you said you're stuck with .NET 1.1 :(
 
P

PL

Ben said:
Remember that only __gc objects are garbage collected, and the new
operator
can also allocate from the native heap. This is distinguished a lot
better in C++/CLI, but you said you're stuck with .NET 1.1 :(

Thanks! However, it looks like all objects are declared using __gc, so maybe
the memory leaks are an artefact of compiling in debug mode only?
 
P

PL

It looks like all the dynamically allocated objects are decorated
with the gc moniker. I don't like to contemplate this, but does the
CLR/garbage collector not work properly in debug build?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top