Ticket #11684 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Crash in wxDataViewMainWindow::OnMouse

Reported by: _Cool- Owned by:
Priority: normal Milestone:
Component: GUI-generic Version: 2.9-svn
Keywords: datavgen.cpp Cc:
Blocked By: Patch: no
Blocking:

Description

file: generic/datavgen.cpp
method: void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
line: SendSelectionChangedEvent(GetItemByRow(m_selection[0]) );
May be need to change to:

if (m_selection.size()>0) SendSelectionChangedEvent(GetItemByRow(m_selection[0]) );

becouse when i select line and after press left mouse with CTRL button on this line - programm crashes.

Change History

Changed 3 years ago by vadz

  • status changed from new to confirmed

Thanks for reporting this but I don't think it's correct to not send any events at all in this case, we should still notify about the selection change. We probably should just use current row instead of m_selection[0].

Changed 3 years ago by VZ

  • status changed from confirmed to closed
  • resolution set to fixed

(In [63382]) Fix selection event sending for Ctrl-click in generic wxDataViewCtrl.

Ctrl-clicking on the only currently selected item in wxDataViewCtrl crashed
because we dereferenced first element of the empty m_selection array when
generating the selection change event.

Instead, send the event for the current item, this should be more consistent
with the native versions behaviour and at the very least doesn't crash.

Closes #11684.

Note: See TracTickets for help on using tickets.