diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-08-17 23:15:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-08-17 23:15:00 +0100 |
| commit | 0ae99c6e3a72e9c8eb620e0707ee3d6f356207dc (patch) | |
| tree | fad8eeb3e6fb8dbe2177976df3cbac2a84d64be2 /src/wx/editable_list.h | |
| parent | 809f6ddd6e76d4e2fa1e0c16d4a1141e8a6b1951 (diff) | |
Fix some crashiness on removing things from EditableList.
Diffstat (limited to 'src/wx/editable_list.h')
| -rw-r--r-- | src/wx/editable_list.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h index 5eb46e80d..98e7d0bfd 100644 --- a/src/wx/editable_list.h +++ b/src/wx/editable_list.h @@ -143,13 +143,16 @@ private: void remove_clicked () { int i = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); - if (i >= 0) { - _list->DeleteItem (i); + if (i == -1) { + return; } + _list->DeleteItem (i); std::vector<T> all = _get (); all.erase (all.begin() + i); _set (all); + + selection_changed (); } void resized (wxSizeEvent& ev) |
