Hi Even,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I'm using Visual studio&nbsp; 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()-&gt;GetDriverByName("GTiff");<br>GDALDataset *in_img = (GDALDataset*) GDALOpen(input_file_name.c_str(), GA_ReadOnly);<br>GDALRasterBand *band = in_img-&gt;GetRasterBand(1);<br>unsigned short *in_buff = new unsigned short[size_x * size_y];<br>band-&gt;RasterIO(GF_Read, 0, 0, size_x, size_y, in_buff, size_x, size_y, GDT_UInt16, 0, 0);<br>GDALDataset *out_img = drv-&gt;Create(output_file_name.c_str(), size_x, size_y, 3, GDT_UInt16, NULL);<br>band = out_img-&gt;GetRasterBand(1);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; band-&gt;RasterIO(GF_Write, 0, 0, size_x, size_y, in_buff, size_x, size_y, GDT_UInt16,
 0, 0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;GDALClose( out_img );<br>&nbsp;GDALClose( in_img );<br><br>&nbsp;delete[] in_buff;<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br>VSICleanupFileManager();<br>GDALDestroyDriverManager();<br>CPLCleanupTLS();<br>CPLFinderClean();<br>CPLFreeConfig();<br><br>.....<br>.....<br>}<br><br><b><i>Even Rouault &lt;even.rouault@mines-paris.org&gt;</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&nbsp;:<br>&gt; Hi ,<br>&gt;      I have been trying to fix (or to be more appropriate, find the cleanup<br>&gt; calls to fix) the memory and resource leaks in my application(which uses<br>&gt; GDAL to read and write to a tif file). I have tried all the cleanup calls<br>&gt; mentioned in the end of :<br>&gt;<br>&gt; http://www.gdal.org/gdalinfo.c.html<br>&gt;<br>&gt; and reduced lot of memory/resource leaks......But i still get a memory leak<br>&gt; pointing in "GDALDataset  Create( ...)"  and few resource leaks of Mutex<br>&gt; and TLsAlloc.<br>&gt;<br>&gt; I would really appreciate if anyone can recommend the right cleanup calls<br>&gt; for the above leaks or hint me in the right direction.<br>&gt;<br>&gt; Thanks<br>&gt;<br>&gt; Sanjay<br>&gt;<br>&gt;<br>&gt;<br>&gt; "If you look at what you do not have in life, you don't have anything"<br>&gt; "If you look at what you have in life, you have everything"<br>&gt;<br>&gt;
 ---------------------------------<br>&gt; Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it<br>&gt; 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>&#32;

      <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>