[QGIS-Developer] symbolLayerCount() on many layers crashes QGIS 3.38..

Info O.GIS info at opengis.it
Fri Sep 6 01:49:10 PDT 2024


   Good morning,
   I've done a lot of tests and I can't figure it out.
   QGIS 3.36 and earlier do not show this problem, from QGIS 3.38... version the error occurs.

   Situation:
   I'm running code with qgis2web(plugin), if I use symbol.symbolLayerCount() on a single layer there are no problems and there are no problems even if I add further layers (one at a time). But if I use symbol.symbolLayerCount() at startup on many layers the crash occurs. It almost seems like there is a memory error, but why?
   The PC I use is extremely powerful.

   How to reproduce the error:

   Insert many layers into QGIS 3.38.. , even with the same source, use the categorized style on a field with many values.
   Make all the layers visible and start qgis2web, click on Preview (if you have qtwebengine installed) or on Export

   Video:

   I attach a gif of the behavior. First I use qgis2web with just one layer and add the others one at a time.
   Then I reload the plugin and use qgis2web with all layers together and show the error.

   Example project:

   I attach an example project

   Python Stack Trace:
Windows fatal exception: access violation
Current thread 0x00002128 (most recent call first):
  File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletLayerScripts.py", line 511 in buildPointJSON
    slCount = symbol.symbolLayerCount()
  File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletLayerScripts.py", line 422 in pointLayer
    useMultiStyle) = buildPointJSON(symbol, safeLayerName, usedFields,
  File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletLayerScripts.py", line 388 in getLayer
    useMultiStyle) = pointLayer(layer, safeLayerName, interactive,
  File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletLayerScripts.py", line 132 in writeVectorLayer
    useMultiStyle) = getLayer(layer, renderer, safeLayerName, interactive,
  File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletWriter.py", line 276 in writeLeaflet
    useOSMB) = writeVectorLayer(layer, safeLayerName,
  File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletWriter.py", line 94 in write
    self.preview_file = self.writeLeaflet(
  File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 453 in createPreview
    preview_file = writer.write(self.iface, dest_folder=utils.tempFolder()).index_file
  File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 491 in previewMap
    preview_file = self.createPreview()

   Thank you all

   Andrea Ordonselli
   O.GIS - opengis.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20240906/13ee7a0f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QGIS 3.38 symbolLayerCount() crash.gif
Type: image/gif
Size: 3035856 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20240906/13ee7a0f/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Example project.zip
Type: application/x-zip-compressed
Size: 366567 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20240906/13ee7a0f/attachment-0001.bin>


More information about the QGIS-Developer mailing list