Opened 5 years ago

Closed 5 years ago

#11684 closed defect (fixed)

Crash in wxDataViewMainWindow::OnMouse

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

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 (2)

comment:1 Changed 5 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].

comment:2 Changed 5 years ago by VZ

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

(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.