Hi Even,<br> I'm using Visual studio with devpartner and below is the part of my app(but reproduces the leaks i have mentioned), its just simply reading from a tif file and creating a another one:<br><br>main()<br>{<br>.........<br>.........<br>GDALAllRegister();<br>GDALDriver *drv = GetGDALDriverManager()->GetDriverByName("GTiff");<br>GDALDataset *in_img = (GDALDataset*) GDALOpen(input_file_name.c_str(), GA_ReadOnly);<br>GDALRasterBand *band = in_img->GetRasterBand(1);<br>unsigned short *in_buff = new unsigned short[size_x * size_y];<br>band->RasterIO(GF_Read, 0, 0, size_x, size_y, in_buff, size_x, size_y, GDT_UInt16, 0, 0);<br>GDALDataset *out_img = drv->Create(output_file_name.c_str(), size_x, size_y, 3, GDT_UInt16, NULL);<br>band = out_img->GetRasterBand(1);<br> band->RasterIO(GF_Write, 0, 0, size_x, size_y, in_buff, size_x, size_y, GDT_UInt16,
0, 0);<br> <br> GDALClose( out_img );<br> GDALClose( in_img );<br><br> delete[] in_buff;<br><br> <br>VSICleanupFileManager();<br>GDALDestroyDriverManager();<br>CPLCleanupTLS();<br>CPLFinderClean();<br>CPLFreeConfig();<br><br>.....<br>.....<br>}<br><br><b><i>Even Rouault <even.rouault@mines-paris.org></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hi,<br><br>If you want precise help, you should mention the exact version of GDAL you're <br>using, and report the exact message you get from your memory leak detector, <br>including filenames and line numbers. (If you use Valgrind under Linux, a <br>Valgrind trace would help a lot). Your source code would of course help to <br>see if it's a memory leak in GDAL or in the way you're using it in your code.<br><br>Best regards.<br><br>Le Thursday 24 January 2008
10:41:45 sanjay boddhu, vous avez écrit :<br>> Hi ,<br>> I have been trying to fix (or to be more appropriate, find the cleanup<br>> calls to fix) the memory and resource leaks in my application(which uses<br>> GDAL to read and write to a tif file). I have tried all the cleanup calls<br>> mentioned in the end of :<br>><br>> http://www.gdal.org/gdalinfo.c.html<br>><br>> and reduced lot of memory/resource leaks......But i still get a memory leak<br>> pointing in "GDALDataset Create( ...)" and few resource leaks of Mutex<br>> and TLsAlloc.<br>><br>> I would really appreciate if anyone can recommend the right cleanup calls<br>> for the above leaks or hint me in the right direction.<br>><br>> Thanks<br>><br>> Sanjay<br>><br>><br>><br>> "If you look at what you do not have in life, you don't have anything"<br>> "If you look at what you have in life, you have everything"<br>><br>>
---------------------------------<br>> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it<br>> now.<br><br><br></blockquote><br><BR><BR>"If you look at what you do not have in life, you don't have anything"<br>"If you look at what you have in life, you have everything"<p> 
<hr size=1>Never miss a thing. <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>