Opened 11 years ago

Closed 11 years ago

#12552 closed defect (fixed)

Crash when adding columns to any wxPGProperty

Reported by: jhughes Owned by:
Priority: normal Milestone:
Component: wxPropertyGrid Version: 2.9.1
Keywords: crash wxPGProperty Cc:
Blocked By: Blocking:
Patch: no


I ran into a problem where I was trying to show a property grid with 3 columns, with Name/Value/Type rather than just Name/Value. It looks like there's a bug in the way EnsureCells() was coded to clone some default object data for a cell that is invalid, which causes a crash.

wxBoolProperty *prop = new wxBoolProperty("foo", true);
prop->SetCell(2, wxPGCell("bool")); crash

Note, it doesn't matter if I use GetOrCreateCell() or any other variation, EnsureCells() is called and crashes before any of those functions actually do anything with the new cell.

I'm running 2.9.1 with MSVC2008 and Windows 7.

Change History (2)

comment:1 Changed 11 years ago by jmsalli

  • Priority changed from high to normal
  • Status changed from new to confirmed

Ok, thanks for reporting this. Looks like the crash happens only if SetCell() is called for a property that is not yet added to the grid.

comment:2 Changed 11 years ago by JMS

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

(In [65788]) When wxPGProperty is un-attached from wxPropertyGrid, keep its 'default' cell references invalid/NULL (fixes #12552)

Note: See TracTickets for help on using tickets.