Opened 9 months ago

Closed 9 months 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

Description

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:
m_object->SetParent(NULL);
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 9 months ago.

Download all attachments as: .zip

Change History (2)

Changed 9 months ago by dghart

comment:1 Changed 9 months 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.