<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QT 5.15 Windows Crash on deallocation of QModelIndexList]]></title><description><![CDATA[<p dir="auto">I'm with the Freespace 2 SCP and we are  getting a crash on deallocation of QModelndexList on debug. I know this is similar to several previous reports. I am on windows 11 and installed Qt Using the online installer. We are almost certainly linking to the correct libraries as the images below show.<br />
Can anybody help?</p>
<p dir="auto">The error message we are getting is this.<br />
<img src="https://ddgobkiprc33d.cloudfront.net/4e1b14ff-8c35-428f-aae9-690fa9bb9b4e.png" alt="30fdad8c-9097-4c0f-9463-46bf24305778-image.png" class=" img-fluid img-markdown" /><br />
The relevant section of code.</p>
<pre><code>	auto list = ui-&gt;shipCombo-&gt;model()-&gt;match(ui-&gt;shipCombo-&gt;model()-&gt;index(0, 0), Qt::UserRole, ship_class);
	if (!list.empty() || ui-&gt;classList-&gt;model()-&gt;rowCount() == 0) {
		ui-&gt;shipCombo-&gt;setCurrentIndex(list.first().row());
	} else {
             //Show error message
	}

	list =
		ui-&gt;variableCombo-&gt;model()-&gt;match(ui-&gt;variableCombo-&gt;model()-&gt;index(0, 0), Qt::UserRole, variable);
	if (!list.empty() || ui-&gt;classList-&gt;model()-&gt;rowCount() == 0) {
		ui-&gt;variableCombo-&gt;setCurrentIndex(list.first().row());
	} else {
		//Show error message
	}
</code></pre>
<p dir="auto">Here is the proof that we are linking to the right libraries given that that seems to be the most common solution provided.<br />
<img src="https://ddgobkiprc33d.cloudfront.net/f6b64113-fbb0-411b-ba44-a50f69840784.png" alt="eecf00b8-f516-4853-9579-a1ca8f938976-image.png" class=" img-fluid img-markdown" /><br />
<img src="https://ddgobkiprc33d.cloudfront.net/8ccb25d7-755c-4725-a9f4-461482b7fe72.png" alt="2eafccab-53e9-4d7f-8d30-cfec3b201c7e-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/163029/qt-5.15-windows-crash-on-deallocation-of-qmodelindexlist</link><generator>RSS for Node</generator><lastBuildDate>Mon, 11 May 2026 00:51:48 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/163029.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 Aug 2025 10:59:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QT 5.15 Windows Crash on deallocation of QModelIndexList on Tue, 19 Aug 2025 18:52:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/the-force">@<bdi>The-Force</bdi></a> said in <a href="/post/830643">QT 5.15 Windows Crash on deallocation of QModelIndexList</a>:</p>
<blockquote>
<p dir="auto">__acrt_first_block == header</p>
</blockquote>
<p dir="auto">...usually points at out-of-bounds access.</p>
<pre><code>if (!list.empty() || ui-&gt;classList-&gt;model()-&gt;rowCount() == 0)
     ui-&gt;shipCombo-&gt;setCurrentIndex(list.first().row());
</code></pre>
<p dir="auto">If <code>list</code> <em>is</em> empty and the model's row count is zero, <code>list.first()</code> causes a read out of bounds and is probably the reason for the crash.</p>
<p dir="auto">Something like</p>
<pre><code>if (!list.empty() &amp;&amp; ui-&gt;classList-&gt;model()-&gt;rowCount() != 0)
     ui-&gt;shipCombo-&gt;setCurrentIndex(list.first().row());
</code></pre>
<p dir="auto">...would make more sense to me.</p>
]]></description><link>https://forum.qt.io/post/830663</link><guid isPermaLink="true">https://forum.qt.io/post/830663</guid><dc:creator><![CDATA[Axel Spoerl]]></dc:creator><pubDate>Tue, 19 Aug 2025 18:52:57 GMT</pubDate></item><item><title><![CDATA[Reply to QT 5.15 Windows Crash on deallocation of QModelIndexList on Tue, 19 Aug 2025 14:35:59 GMT]]></title><description><![CDATA[<p dir="auto">Actually I've just found our solution here</p>
<p dir="auto"><a href="https://forum.qt.io/topic/157255/getting-debug-heap-correction-from-destructor-of-qstringlist/19">https://forum.qt.io/topic/157255/getting-debug-heap-correction-from-destructor-of-qstringlist/19</a></p>
<p dir="auto">I seems that our camke config has not been linking msvcrtd.lib</p>
]]></description><link>https://forum.qt.io/post/830658</link><guid isPermaLink="true">https://forum.qt.io/post/830658</guid><dc:creator><![CDATA[The Force]]></dc:creator><pubDate>Tue, 19 Aug 2025 14:35:59 GMT</pubDate></item><item><title><![CDATA[Reply to QT 5.15 Windows Crash on deallocation of QModelIndexList on Tue, 19 Aug 2025 13:49:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/the-force">@<bdi>The-Force</bdi></a> said in <a href="/post/830643">QT 5.15 Windows Crash on deallocation of QModelIndexList</a>:</p>
<blockquote>
<p dir="auto">I know this is similar to several previous reports.</p>
</blockquote>
<p dir="auto">Which reports?  Can we have some links?</p>
]]></description><link>https://forum.qt.io/post/830652</link><guid isPermaLink="true">https://forum.qt.io/post/830652</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 19 Aug 2025 13:49:27 GMT</pubDate></item></channel></rss>