Hi Peter, Happy you found a way. Can you try proposals number 2 and 3 from my previous email? If they do not help, please open a ticket. Bests Matthias
> Hi Matthias, > Thanks to your hints I found a way: > The script also works if I do not add the Layer to the Project but directly > save the Sld-Style. So I can also skip clearing the QgsProject.instance. > > vlayer=QgsVectorLayer (pfad ,sfileOhneExt,"ogr") > #QgsProject.instance().addMapLayer(vlayer) > vlayer.saveSldStyle (sldpfad) > #QgsProject.instance().clear() > > But besides my personal “success”: including the 2 Lines should not lead to > rising time /memory consumption or am I wrong? > Should I make a ticket? > > Peter > > Hi Peter, > > It's possible that a part of the cleanup only happens on the next event loop > run. > > Questions / things to try: > > - Do you really need to add them to the project or is a layer without adding > it to the project good enough for your purpose? > - Can you run this in batches of ~100 (or even 1) each and then trigger the > next batch on a new event loop invocation, e.g. by using QTimer.singleShot() > - The easiest thing would be calling QgsApplication.processEvents(), but be > warned that using this is known for introducing instabilities, depending on > the context in which it is called > > Matthias > > > >
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
