<div dir="ltr"><div>Dear Greg,</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">pá 26. 12. 2025 v 16:48 odesílatel Greg Troxel via QGIS-User <<a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a>> napsal:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I would suggest reading the gdal code to try to understand this.<br></blockquote><div><br></div><div>First of all, thanks for the quick answer! I wonder which gdal code do you mean?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Looking at your code above, I wonder if the layer returned by clip_layer<br>
holds a reference to the first argument. (This should be easy to<br>
understand from code reading).<br></blockquote><div><br></div><div>If I replace the clip_layer() function with calling `extractbyextent` from processing, the result is the same. Number of open files is increasing. It seems to me that files open by QgsVectorMapLayer constructors are not closed properly even when releasing memory via `del`...</div><div><br></div><div>Best regards, Martin</div><div> </div></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Martin Landa<div><a href="https://geomatics.fsv.cvut.cz/en/employees/martin-landa/" target="_blank">https://geomatics.fsv.cvut.cz/en/employees/martin-landa/</a><br><a href="https://gismentors.cz/mentors/landa" target="_blank">https://gismentors.cz/mentors/landa</a></div></div></div></div>