Martin Landa via QGIS-User <[email protected]> writes: > for sublayer in layers: > name = sublayer.name() > layer = QgsVectorLayer(sublayer.uri(), 'ogr') > > clipped_layer = clip_layer(layer, extent, layer.name()) > > del layer > > print(name, open_files_count()) > if clipped_layer.featureCount() == 0: > del clipped_layer > continue > clipped_layers.append(clipped_layer) > """
I would suggest reading the gdal code to try to understand this. Looking at your code above, I wonder if the layer returned by clip_layer holds a reference to the first argument. (This should be easy to understand from code reading). _______________________________________________ QGIS-User mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
