I have just used C::B (current trunk) on Mint 18 and get an assertion when closing C::B. It only asserts with the release, not the debug version, so I have a limited backtrace.
../src/generic/listctrl.cpp (3386)
assert "litem >= 0 && (size_t)litem < GetItemCount() failed in SetItemState(): invalid list ctrl item index in SetItem
Backtrace
1 wxGenericListCtrl::SetItemState(long, long, long)
2 JumpTrackerView::SetJumpTrackerViewIndex(int)
3 JumpTracker::SetJumpTrackerViewIndex(int)
4 JumpTracker::JumpDataAdd(wxString const&, long, long)
5 JumpTracker::OnEditorActivated(CodeBlocksEvent&)
What wxWidgets version? I will see if the problems happens under Win10 MSys2 UCRT64.
Tim S.
wxWidgets 3.0.2 32 bits
GTK+ 2.24.30
Hi Miguel Gimenez, I have seen such a crash earlier. https://github.com/josephch/codeblocks/commit/5be7d91c955a481a48abe545a86342e9b30f8ed7 should help with this as list item's index should be always less than item count.
Quote from: christo on October 21, 2025, 07:44:53 PM
Hi Miguel Gimenez, I have seen such a crash earlier. https://github.com/josephch/codeblocks/commit/5be7d91c955a481a48abe545a86342e9b30f8ed7 should help with this as list item's index should be always less than item count.
I'll make the change and test awhile.
Thanks
Leap-15.6-64bits, gcc-1520, wx-328, gtk3-unicode-3.2
Cb13752
Identical problem :
I did this :
void SetJumpTrackerViewIndex(int itemIndex)
{
if (itemIndex < 0)
return;
int knt = m_pListCtrl->GetItemCount();
if (knt < 0)
return;
if (itemIndex >= knt)
return; //setting index before adding the item
m_pListCtrl->SetItemState(itemIndex, wxLIST_STATE_SELECTED , wxLIST_STATE_SELECTED);
}
I'm testing a day ...
Fixes applied svn 13753
Thanks