   stuck with a bug
  hi guys i am stuck with a bug in my code,can some one please solve this :)vector<Quad*> GenerateQuads(Vector3i minn,Vector3i maxx,int widthpercell){vector<Quad*> quads;vector<int> val;int width=(int)(maxx.x-minn.x);int length=(int)(maxx.x-minn.z);for (int i=(int)minn.x;i<(int)maxx.x;i+=widthpercell){for(int j=(int)minn.z;j<(int)maxx.z;j+=widthpercell){Vector3i min=Vector3i(i,(int)minn.y,j);Vector3i max=Vector3i(i+widthpercell,(int)minn.y,j+widthpercell);Quad* quad=new Quad;   /// crashing herequad->min=min;quad->max=max;quad->normal=Vector3f(0,1,0);quads.push_back(quad);}}return quads;}// my program is cashing here all the time, i guess its a memory leak and i am calling this one like this ParticleQuadRegister::ParticleQuadRegister( Vector3i worldmin,Vector3i worldmax,int sidelength ) :worldmax(worldmax),worldmin(worldmin),sidelength(sidelength){quads=GenerateQuads(worldmin,worldmax,sidelength);/// here i am calling itvector<int> ints;int sized=quads.size();quadsized=sized;for (int i=0;i<sized;i++){ParticleQuadStorage.insert(make_pair(i,ints));}width=(int)(worldmax.x-worldmin.x);width/=sidelength;}[Edited by - Zahlman on May 11, 2010 5:55:53 PM]
  Before I take a look at the code, would you edit your post and copy the code again between [source] and [/source]? So we'll have some syntax highlight and indentation.   ;  Have you checked that sidelength is >0 ?   ;  ya sidelength is always 10 i guess its problem with iterator functions , it is crashing at xtree line 256.   