<span style="font-family: Arial; font-size: small;" xam-editor-container="true"><div>I attached a debugger to QGIS and I get this error on crash, any ideas on how to proceed?</div><div><br /></div><i>Exception thrown at 0x00007FFFD0E9BD63 (Qt5Core.dll) in qgis-bin.exe: 0xC0000005: Access violation reading location 0x0000000000000024.</i><br /><br /><br /><div data-signature-id="1">
<div class="xam_msg_class">
<span style="font-family: Arial; font-size: small;" xam-editor-container="true">
<div class="xam_msg_class">
<span style="font-family: Arial; font-size: small;" xam-editor-container="true">
<div class="xam_msg_class">
<span style="font-family: Arial; font-size: medium;" xam-editor-container="true">
<div class="xam_msg_class">
<span style="font-family: Arial;" xam-editor-container="true"><font size="2">
</font><div class="xam_msg_class" style=""><span style="color: rgb(0, 89, 179); font-family: Calibri, sans-serif; font-size: small;"><b>Andrea Ordonselli</b></span><br style="font-size: small;" /><div data-signature-id="1" style="font-size: small;"><div class="xam_msg_class"><span style="font-size: medium;" xam-editor-container="true"><font size="2"></font><div class="xam_msg_class"><span xam-editor-container="true"><b><span style="line-height: 18.4px; font-family: Calibri, sans-serif; color: rgb(0, 89, 179);"><font size="2">O.GIS - </font></span></b></span><b><span style="line-height: 18.4px; font-family: Calibri, sans-serif; color: rgb(0, 89, 179);"><font size="2">opengis.it</font></span></b></div></span></div></div>
</div>
</span>
</div>
</span>
</div>
</span>
</div>
</span>
</div>
</div><br /><br /><div class="xam-quoted-text xam-reply-text"><div style="border-left: 3px solid #000000; padding-left: 10px;"><div><span style="font-family:Arial; font-size:11px; color:#5F5F5F;">Da</span><span style="font-family:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> "Info O.GIS" info@opengis.it</span></div>
<div><span style="font-family:Arial; font-size:11px; color:#5F5F5F;">A</span><span style="font-family:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> "qgis-developer" qgis-developer@lists.osgeo.org</span></div>
<div><span style="font-family:Arial; font-size:11px; color:#5F5F5F;">Cc</span><span style="font-family:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> </span></div>
<div><span style="font-family:Arial; font-size:11px; color:#5F5F5F;">Data</span><span style="font-family:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> Fri, 6 Sep 2024 10:49:10 +0200</span></div>
<div><span style="font-family:Arial; font-size:11px; color:#5F5F5F;">Oggetto</span><span style="font-family:Arial; font-size:12px; color:#5F5F5F; padding-left:5px;"> symbolLayerCount() on many layers crashes QGIS 3.38..</span></div>
<br />
<div class="xam_msg_class">
<span style="font-family: Arial; font-size: small;" xam-editor-container="true"><div><div>Good morning,</div><div>I've done a lot of tests and I can't figure it out.</div><div>QGIS 3.36 and earlier do not show this problem, from QGIS 3.38... version the error occurs.</div></div><div><br /></div><div><div><b>Situation:</b></div><div>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?</div><div>The PC I use is extremely powerful.</div></div><div><br /></div><div><b>How to reproduce the error:</b></div><div><div>Insert many layers into QGIS 3.38.. , even with the same source, use the categorized style on a field with many values.</div><div>Make all the layers visible and start qgis2web, click on Preview (if you have qtwebengine installed) or on Export</div></div><div><br /></div><div><b>Video:</b></div><div><div>I attach a gif of the behavior. First I use qgis2web with just one layer and add the others one at a time.</div><div>Then I reload the plugin and use qgis2web with all layers together and show the error.</div></div><div><br /></div><div><b>Example project:</b></div><div>I attach an example project</div><div><br /></div><div><br /></div><div><p style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-weight:600;">Python Stack Trace:</span></p>
<pre style="margin-top: 12px; margin-bottom: 0px;"><span style=" font-family:Courier New;">Windows fatal exception: access violation</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px; font-family: "Courier New";"><br /></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;">Current thread 0x00002128 (most recent call first):</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletLayerScripts.py", line 511 in buildPointJSON</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> slCount = symbol.symbolLayerCount()</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletLayerScripts.py", line 422 in pointLayer</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> useMultiStyle) = buildPointJSON(symbol, safeLayerName, usedFields,</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletLayerScripts.py", line 388 in getLayer</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> useMultiStyle) = pointLayer(layer, safeLayerName, interactive,</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletLayerScripts.py", line 132 in writeVectorLayer</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> useMultiStyle) = getLayer(layer, renderer, safeLayerName, interactive,</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletWriter.py", line 276 in writeLeaflet</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> useOSMB) = writeVectorLayer(layer, safeLayerName,</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\leafletWriter.py", line 94 in write</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> self.preview_file = self.writeLeaflet(</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 453 in createPreview</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> preview_file = writer.write(self.iface, dest_folder=utils.tempFolder()).index_file</span></pre>
<pre style="margin-top: 0px; margin-bottom: 0px;"><span style=" font-family:Courier New;"> File "C:\Users/Utente/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\maindialog.py", line 491 in previewMap</span></pre>
<pre style="margin-top: 0px; margin-bottom: 12px;"><span style=" font-family:Courier New;"> preview_file = self.createPreview()</span></pre></div><div><br /></div><div>Thank you all</div><div><br /><br /><div data-signature-id="1">
<div class="xam_msg_class">
<span style="font-family: Arial; font-size: small;" xam-editor-container="true">
<div class="xam_msg_class">
<span style="font-family: Arial; font-size: small;" xam-editor-container="true">
<div class="xam_msg_class">
<span style="font-family: Arial; font-size: medium;" xam-editor-container="true">
<div class="xam_msg_class">
<span style="font-family: Arial;" xam-editor-container="true"><font size="2">
</font><div class="xam_msg_class" style=""><span style="color: rgb(0, 89, 179); font-family: Calibri, sans-serif; font-size: small;"><b>Andrea Ordonselli</b></span><br style="font-size: small;" /><div data-signature-id="1" style="font-size: small;"><div class="xam_msg_class"><span style="font-size: medium;" xam-editor-container="true"><font size="2"></font><div class="xam_msg_class"><span xam-editor-container="true"><b><span style="line-height: 18.4px; font-family: Calibri, sans-serif; color: rgb(0, 89, 179);"><font size="2">O.GIS - </font></span></b></span><b><span style="line-height: 18.4px; font-family: Calibri, sans-serif; color: rgb(0, 89, 179);"><font size="2">opengis.it</font></span></b></div></span></div></div>
</div>
</span>
</div>
</span>
</div>
</span>
</div>
</span>
</div>
</div></div></span>
</div>
</div></div></span>