Opened 7 months ago

Closed 5 months ago

#15897 closed defect (fixed)

wxNotebook::RemovePage leads to assertion

Reported by: Stegei Owned by: VZ
Priority: normal Milestone:
Component: wxOSX-Cocoa Version: dev-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

When removing the last page on wxOSX/Cocoa of a wxNotebook, the function wxNotebook::DoRemovePage will call GetPeer()->SetValue with a value of 0. The implementation of SetValue(int value) will then call [slf selectTabViewItemAtIndex:(uint)-1]; which is invalid.

My solution is to simply avoid calling selectTabViewItemAtIndex if the value is 0.

Please check the attached patch for the fix.

Attachments (1)

notebook.mm.patch download (562 bytes) - added by Stegei 7 months ago.
Patch for wxCocoaTabView::SetValue

Download all attachments as: .zip

Change History (6)

Changed 7 months ago by Stegei

Patch for wxCocoaTabView::SetValue

comment:1 Changed 7 months ago by VZ

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

(In [75663]) Avoid selecting invalid tab when removing last page from wxOSX wxNotebook.

Closes #15897.

comment:2 Changed 7 months ago by vadz

  • Resolution changed from fixed to port to stable
  • Status changed from closed to portneeded

This should be backported if no problems are found with this fix.

comment:3 Changed 5 months ago by vadz

  • Status changed from portneeded to closed

As we don't plan to make any more 2.8 releases, closing all bugs with "port to 2.8 needed" status.

comment:4 Changed 5 months ago by vadz

  • Status changed from closed to portneeded

Please disregard the last comment, it was a mistake.

comment:5 Changed 5 months ago by VZ

  • Owner set to VZ
  • Resolution changed from port to stable to fixed
  • Status changed from portneeded to closed

In 76319:

Avoid selecting invalid tab when removing last page from wxOSX wxNotebook.

Closes #15897 (backport of r75663 from trunk).

Note: See TracTickets for help on using tickets.