views:

218

answers:

1

hi!

following code:

_CrtCheckMemory();
vector<Vector3> samples = PoissonDisk::generate_poisson(m_resX-1, m_resY-1, minDist, 30, m_samples);
_CrtCheckMemory();
int s = samples.size();

the debugger traps into the heapcheck function in the second _CrtCheckMemory() telling me there's something wrong with the heap - so my assumption is that my generate_poisson function is doing a mess. however - if i add a _CrtCheckMemory(); call directly at the end of the generate_poisson function, right before return, then the debugger still traps on the same line as before, not on the newly added _CrtCheckMemory()

what could this mean?

thanks!

//edit: could it be possible that another thread is messing up the heap, or does _CrtCheckMemory() only check the heap of the current thread?

A: 

Could mean your "Vector3" class is the real mess. Check its constructor.

JohnF
hi!my Vector3 class just stores 3 doubles and has some functions for basic math. no pointer code, no allocations, nothing. i put a _CrtCheckMemory(); into the constructor of Vector3 but it still traps at the other location
Mat