ogx / Calculation2D

Extensible 2D image processing framework for C++
3 stars 0 forks source link

Massive memory leaks in calc2d #85

Closed malleor closed 12 years ago

malleor commented 12 years ago

Two calculation runs. ~100MB leaked per calculation.

carasuca commented 12 years ago

will check base64 code ASAP, maybe it got over-optimized...

malleor commented 12 years ago

@carasuca Any clue on what's the source?

carasuca commented 12 years ago

I've used this testing routine - haven't found anything. To narrow it down, can you make similar test runs without base64 function calls. I'll try to run it with _CrtDumpMemoryLeaks();

carasuca commented 12 years ago

ok found some stuff: mmImages::mmLayer::~mmLayer(void) never gets called - this causes a handful of leaks. possible causes: non-virtual destructor (nope), no explicit deletion called (still to check)

still more to come...

carasuca commented 12 years ago

little bugger doesn't want to get destroyed.

carasuca commented 12 years ago

i'll try to remove as much as I can.

malleor commented 12 years ago

@carasuca The image structure doesn't clean its images. Whoops.

carasuca commented 12 years ago

yep. Another interesting fact:

    delete [] v_prPixels,  v_prNewPixels;

is not:

    delete [] v_prPixels;
    delete [] v_prNewPixels;

I thought the former only allays suspicions, because the debugger won't detect memory leak that easily - after all, something gets deallocated at v_prNewPixels. There is no ::operator delete[] call though, nor there is any other call. AFAIK the scalar version doesn't get called either. nada!

@ogx what do you think?

malleor commented 12 years ago

LOL, a comma operator hunted you down :D