Opened 4 years ago
Closed 4 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 |
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)
Change History (2)
Changed 4 years ago by dghart
comment:1 Changed 4 years ago by juliansmart
- Resolution set to fixed
- Status changed from new to closed
Many thanks, now applied to trunk and wx30.