<div dir="ltr">Hi list,<div><br></div><div>For an enum (not scoped based), I am running this code:</div><div><br></div><div>for i in range(0, 100):<br>    idx = QgsDataSourceUri.staticMetaObject.indexOfEnumerator(QgsDataSourceUri.SslMode.__name__)<br>    meta_enum = QgsDataSourceUri.staticMetaObject.enumerator(idx)<br>    print(meta_enum.isValid())<br>    sleep(.3)<br></div><div><br></div><div>I usually get a crash after 2 to 6 iterations.</div><div>Code is hereunder.</div><div><br></div><div>As far as I can tell, this happens to any version of SIP above 4.19.17 (not tested under).</div><div><br></div><div>Cheers,</div><div>Denis</div><div><br></div><div>The enum is defined as follows:</div><div><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">class</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">CORE_EXPORT</span><span style="color:rgb(192,192,192)"> </span><span style="font-weight:600;color:rgb(128,0,128)">QgsDataSourceUri</span></pre>
<pre style="margin-top:0px;margin-bottom:0px">{</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,128)">Q_GADGET</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,128,0)">public</span>:</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(192,192,192)">    </span><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(128,128,0)">enum</span><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(192,192,192)"> </span><span style="font-family:Arial,Helvetica,sans-serif;font-weight:600;color:rgb(128,0,128)">SslMode</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>{</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,0,128)">SslPrefer</span>,</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,0,128)">SslDisable</span>,</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,0,128)">SslAllow</span>,</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,0,128)">SslRequire</span>,</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,0,128)">SslVerifyCa</span>,</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span><span style="color:rgb(128,0,128)">SslVerifyFull</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>};</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(0,0,128)">Q_ENUM</span>(<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">SslMode</span><span style="color:rgb(192,192,192)"> </span>)</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="font-weight:600;color:rgb(0,103,124)">QgsDataSourceUri</span>();</pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre></pre></div><div>The sip file:</div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">class</span><span style="color:rgb(192,192,192)"> </span><span style="font-weight:600;color:rgb(128,0,128)">QgsDataSourceUri</span></pre>
<pre style="margin-top:0px;margin-bottom:0px">{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-family:Arial,Helvetica,sans-serif">%</span><span style="font-family:Arial,Helvetica,sans-serif;font-weight:600;color:rgb(128,0,128)">TypeHeaderCode</span><br></pre>
<pre style="margin-top:0px;margin-bottom:0px">#<span style="color:rgb(0,0,128)">include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"qgsdatasourceuri.h"</span></pre>
<pre style="margin-top:0px;margin-bottom:0px">%End</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,128,0)">public</span>:</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">static</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">const</span><span style="color:rgb(192,192,192)"> </span>QMetaObject<span style="color:rgb(192,192,192)"> </span>staticMetaObject;</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">  </span><span style="color:rgb(128,128,0)">public</span>:</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span><span style="color:rgb(128,128,0)">enum</span><span style="color:rgb(192,192,192)"> </span>SslMode</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>{</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span>SslPrefer,</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span>SslDisable,</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span>SslAllow,</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span>SslRequire,</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span>SslVerifyCa,</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">      </span>SslVerifyFull</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>};</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">    </span>QgsDataSourceUri();</pre></div><div><br></div><div><br></div></div>