Opened 7 years ago

Closed 7 years ago

#13604 closed defect (fixed)

assertion failure in wxGenericListCtrl

Reported by: pcor Owned by:
Priority: normal Milestone: 2.9.3
Component: GUI-generic Version: stable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: no


Run listctrl sample, press F3

#7  0x00007ffff7213949 in wxOnAssert (file=0x7ffff7864077 "../src/common/list.cpp", line=318, func=0x7ffff7864a00 "Item", cond=
    0x7ffff7864068 "Assert failure", msg=0x7ffff7864740 L"invalid index in wxListBase::Item") at ../src/common/appbase.cpp:1141
#8  0x00007ffff728cbd8 in wxListBase::Item (this=0x720e40, n=0) at ../src/common/list.cpp:318
#9  0x00007ffff735bd41 in wxObjectList::Item (this=0x720e40, index=1) at ../include/wx/list.h:1194
#10 0x00007ffff735ba57 in wxGenericImageList::GetSize (this=0x720e30, index=1, width=@0x7fffffffca00, height=@0x7fffffffc9fc)
    at ../src/generic/imaglist.cpp:248
#11 0x00007ffff73bdf7c in wxListMainWindow::InsertItem (this=0x7b0c90, item=...) at ../src/generic/listctrl.cpp:4037
#12 0x00007ffff73c05e0 in wxGenericListCtrl::InsertItem (this=0x7af800, info=...) at ../src/generic/listctrl.cpp:4842
#13 0x00007ffff73c071a in wxGenericListCtrl::InsertItem (this=0x7af800, index=1, imageIndex=1) at ../src/generic/listctrl.cpp:4861
#14 0x000000000041285e in MyFrame::InitWithIconItems (this=0x6e39e0, withText=false, sameIcon=false)
    at ../../../samples/listctrl/listtest.cpp:579
#15 0x0000000000411e61 in MyFrame::RecreateList (this=0x6e39e0, flags=4, withText=false)
    at ../../../samples/listctrl/listtest.cpp:454
#16 0x00000000004128a0 in MyFrame::OnIconView (this=0x6e39e0) at ../../../samples/listctrl/listtest.cpp:586

Change History (2)

comment:1 Changed 7 years ago by vadz

  • Status changed from new to confirmed

The code dealing with m_lineHeight is perplexing, it seems to assume that it's only used in report view but this doesn't seem to be the case... Anyhow, I'll just limit this code to report view only too.

comment:2 Changed 7 years ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [69586]) Fix assert in generic wxListCtrl icon view when using images.

Don't assume that the item image is a valid index in m_small_image_list as we
may be in icon view which doesn't use small images at all.

For now restrict this code to the report view mode as apparently the cached
line height is not supposed to be used in other modes even though it's not
clear whether this is really the case and so, perhaps, this code should also
be used when in small icons view mode.

Closes #13604.

Note: See TracTickets for help on using tickets.