Opened 5 years ago

Closed 5 years ago

#15681 closed defect (fixed)

wxRichTextCtrl: Crash when deleting a wxRichTextTable row or column

Reported by: dghart Owned by: juliansmart
Priority: normal Milestone:
Component: wxRichText Version:
Keywords: wxRichTextAction regression crash Cc:
Blocked By: Blocking:
Patch: yes


Since the 254eb68 (r75124) commit, deleting a row or column of a wxRichTextTable crashes with the next paint event. This can be seen in the richtext sample, and the RichTextCtrlTestCase fails with a segfault.

It turns out to be due to the new line in richtextbuffer.cpp:11612:
A wxRichTextAction with the wxRICHTEXT_CHANGE_OBJECT flag does an immediate Do(), at a time when obj and m_object are the same (the current table) so NULLing the parent is going to cause problems.

The patch fixes the crash simply by removing that line. However if it was inserted to solve particular issue, rather than just good practice, checking for obj/m_object identity might work.

Attachments (1)

richtextbuffer.patch download (503 bytes) - added by dghart 5 years ago.

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by dghart

comment:1 Changed 5 years ago by juliansmart

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

Many thanks, now applied to trunk and wx30.

Note: See TracTickets for help on using tickets.