<p></p>
<p>An alternative solution would be:</p>
<div class="highlight highlight-source-c"><pre>           <span class="pl-k">while</span> (widgets[i])
                {
                                <span class="pl-c1">g_object_ref</span>(*(widgets[i]));
                                <span class="pl-c1">gtk_container_remove</span>(<span class="pl-c1">GTK_CONTAINER</span>(<span class="pl-c1">gtk_widget_get_parent</span>(*(widgets[i]))), *(widgets[i]));
                                i++;
                }</pre></div>
<p>to make <code>cppcheck</code> happy but I think the solution in this PR is more readable for humans.</p>
<p>The change in the second loop is not strictly necessary for <code>cppcheck</code> but is more consistent with the first loop where the same array is used.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany-plugins/pull/1017#issuecomment-710784771">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ5UNVRGX7CZN7QOA3DSLFQUPANCNFSM4SUHYX2Q">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAIOWJZCRUUE7KFPDKFYFSDSLFQUPA5CNFSM4SUHYX22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFJO3OAY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany-plugins/pull/1017#issuecomment-710784771",
"url": "https://github.com/geany/geany-plugins/pull/1017#issuecomment-710784771",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>